While reduce can pretty much do anything, I would recommend that you also mention that not to use the same hammer for every kind of nail. We developers like to stay in our familiar territory and that’s why we avoid trying out new things, it would really suck if a fellow developer uses reduce to do everything, when they could have used other more optimised things.
You are absolutely correct. I eluded to the fact that map and filter were more optimized than their reduce implementations, but I need to reiterate that at the end. Thanks for the feedback!
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.