Re:Learn You The Node.js
by mneary on Saturday February 01, 2014 @06:00PM
(#7163853)
A far cleaner solution:
[ Parent
| on HN ]
Awesome! Thanks a ton for the suggestion.
Why is that cleaner? A for-loop is one of the basic programming constructs.
A for-loop might be a basic programming construct, but it shouldn't be. Mutation and a control flow construct makes for a much worse outlook to the problem than does recursive application of a function.
reduce is one very fundamental construct too https://www.google.com/search?q=universality+of+reduce