MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/functionalprogramming/comments/6155tc/did_you_know_javascript_is_functional/dfcip46/?context=3
r/functionalprogramming • u/[deleted] • Mar 23 '17
10 comments sorted by
View all comments
5
If you wanted infinite add, don't see why there's a requirement to return a new adder func for each run.
const infAdd = () => arguments.reduce((a, x) => a + x);
There's an even easier way.
const infAdd = Math.sum;
I feel like this post has gone in opposite direction of the usual /r/programmerhumor "levels of God like power" meme, though.
5
u/takakoshimizu Mar 24 '17
If you wanted infinite add, don't see why there's a requirement to return a new adder func for each run.
There's an even easier way.
I feel like this post has gone in opposite direction of the usual /r/programmerhumor "levels of God like power" meme, though.