3 ms·
Yes, and you get used to reduce. map, filter and reduce were hard for me to follow… until I used them two or three times and now I understand them easily and th
by jraph 6y ago
Yes, and you get used to reduce. map, filter and reduce were hard for me to follow… until I used them two or three times and now I understand them easily and they naturally come to my mind when I need to solve a problem which they can help solving.
They are good tools (especially in codebases shared with people who are allergic to loop statements!)
- doubletgl 6y agoAgreed for map, filter etc. but reduce is the exception. There has been a fad of overusing it, until that article popped up which called it out.
- jraph 6y agoI "got" reduce not long ago. It's occasionally handy, and it makes sense, but sure, it should not be overused. It is the most complicated between the three. A good old loop in code bases that are not afraid of them are totally fine and probably clearer in many cases.