3 ms·
Why is that cleaner? A for-loop is one of the basic programming constructs.
by dsego 13y ago
Why is that cleaner? A for-loop is one of the basic programming constructs.
- agumonkey 13y agoreduce is one very fundamental construct too https://www.google.com/search?q=universality+of+reduce https://www.google.com/search?q=universality+of+reduce
- mneary 13y agoA 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.