Re:Functional JavaScript, Part 3: apply, call, and the argum...
by dccoolgai on Tuesday April 22, 2014 @02:15PM
(#7629347)
I find most JS written functionally (at least if it's done the right way) to be a lot easier to follow if you think of each functional "step" in the chain like columns in a spreadsheet. E.g. when I see something like _(array).filter(...).map(...).reject(...).reduce() I like to think of taking a value and following it the way you would across a spreadsheet and think of filter, map and reject as "columns". I don't know if that will help, but it does for me.
[ Parent
| on HN ]
Re:Functional JavaScript, Part 3: apply, call, and the argum...
by drewblaisdell on Tuesday April 22, 2014 @02:20PM
(#7629384)
> E.g. when I see something like _(array).filter(...).map(...).reject(...).reduce() I like to think of taking a value and following it the way you would across a spreadsheet and think of filter, map and reject as "columns".
This is the practical use of functional Javascript methods after they are written, though. Following the code in the filter/map/reject/etc functions themselves is a bit more difficult.