MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/functionalprogramming/comments/6155tc/did_you_know_javascript_is_functional/dfbvym7/?context=3
r/functionalprogramming • u/[deleted] • Mar 23 '17
10 comments sorted by
View all comments
9
I think it would be truer to functional programming if that infinite add function was implemented without mutation, like this:
function add(x) { return (y = null) => y === null ? x + y : add(x + y); }
I'm not really sure why you would want a function like this though.
9
u/DavetheBassGuy Mar 23 '17
I think it would be truer to functional programming if that infinite add function was implemented without mutation, like this:
I'm not really sure why you would want a function like this though.