3 ms·
Why not just use a for loop?
by cercatrova 4y ago
Why not just use a for loop?
- jcparkyn 4y agoI agree. If your reduce requires mutation, then you almost certainly shouldn't be using reduce.
- dexwiz 4y agoI have pretty much gone back to for loops for anything besides the simplest map()'s. You can get reduce() to do some pretty cool things that always need more lines of comments to explain than a for loop and some variables.
- wiml 4y agoThere's an eslint rule forbidding for loops too.