2 ms·
To understand the nesting you have to evaluate the functions in the opposite order than you're reading them: exclaim capitalize doubleSay Sure, some of us has
by radicalbyte 11y ago
To understand the nesting you have to evaluate the functions in the opposite order than you're reading them:
exclaim capitalize doubleSay
Sure, some of us has spent 20 years doing this so it's easy, but you can't deny that this is far nicer to read:
doubleSay capitalize exclaim
I'm a big fan of Fluent Interfaces, so I use this construct fairly often:
"hello".doubleSay().capitalize().exclaim()
- andrewpe 11y agoThis should be how it's done, simplistic, nothing new to learn, easy to read.