|
|
|
|
|
by joezydeco
3306 days ago
|
|
Right. Show me the compiled object code and tell me how much faster it is. "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan and P. J. Plauger in The Elements of Programming Style. |
|
[0]: https://jsperf.com/foreach-vs-reduce-vs-for-loop
For loops have also an advantage that they can be used with yield and await (generators and async functions) while you cannot place these keywords inside a callback function.