3 ms·
I am going to call that wasteful. A for loop has the ability to do most of these things with ONE iteration over a list or array. Using map/reduce/filter means
by bjoli 9y ago
I am going to call that wasteful. A for loop has the ability to do most of these things with ONE iteration over a list or array.
Using map/reduce/filter means iterating over each subsequent list, making what could be an O(n) algorithm a lot slower.
I understand the quest for clarity, but one has to consider each case.