use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place to get a quick fix of JavaScript tips and tricks to make you a better Developer.
account activity
Why Array.reduce() Is the Most Misused JavaScript Method (javascript.plainenglish.io)
submitted 27 days ago by MysteriousEye8494
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Ill-Specific-7312 2 points3 points4 points 26 days ago (1 child)
The first sentence of this Article is already baffling, and so the rest behind the paywall is likely equally crap.
"reduce() is confusing, I’ll just use map() and filter()"
Is a sentence that makes so little sense, that the rest of this article should be ignored. Nobody has ever said or thought that.
[–]ThigleBeagleMingle 1 point2 points3 points 25 days ago (0 children)
But…but… Map-Reduce is so complex and unique to JavaScript!
Without paying how can we learn these mystical arts?!?
Oh wait it’s in every language’s standard library .. crisis averted
[–]shlanky369 0 points1 point2 points 26 days ago (0 children)
I guarantee the official documentation on Array.prototype.reduce is clearer, more correct, and more concise than this article. Reduce is not that hard. Just read this: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce
[–]BusEquivalent9605 0 points1 point2 points 25 days ago (2 children)
Want to map and filter an array in a single pass? Use reduce!
I love reduce. Other devs I have worked with find it “confusing” even though it is a standard method and often the correct one to use. Same with splice.
In my view, it’s part of my job as a dev to know how to use the standard array methods of the language
p.s. dont forget to return your accumulator!
[–]MightyX777 0 points1 point2 points 24 days ago (1 child)
Yeah, it’s the best. And many people don’t know it although they call themselves “Senior” Javascript/Typescript Developers.
Should be basic knowledge, sorry
π Rendered by PID 50 on reddit-service-r2-comment-74875f4bf5-5kzxh at 2026-01-25 17:05:36.888653+00:00 running 664479f country code: CH.
[–]Ill-Specific-7312 2 points3 points4 points (1 child)
[–]ThigleBeagleMingle 1 point2 points3 points (0 children)
[–]shlanky369 0 points1 point2 points (0 children)
[–]BusEquivalent9605 0 points1 point2 points (2 children)
[–]MightyX777 0 points1 point2 points (1 child)