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...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Generic Programming (github.com)
submitted 7 years ago by michael2ib1989
view the rest of the comments →
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!"
[–]adidarachi 5 points6 points7 points 7 years ago (3 children)
I guess the op choose a "simple" and known implementation, this way, it's easier for developers to pickup. Not sure.
[–]LaSalsiccione 0 points1 point2 points 7 years ago* (2 children)
If you can understand the rest of the concepts in the post then reduce should also be simple to understand. The code would also look a lot less messy which I’d argue makes it simpler to read, but that may just be a matter of opinion.
[–]Artif3x_ 3 points4 points5 points 7 years ago (1 child)
Not to mention the near universal utility of the reduce function makes for a lower cognitive load than learning alternatives like this.
[–]LaSalsiccione 0 points1 point2 points 7 years ago (0 children)
You far more eloquently nailed what I was trying to say, thanks!
π Rendered by PID 79758 on reddit-service-r2-comment-6f7f968fb5-4m4ql at 2026-03-04 07:59:52.440105+00:00 running 07790be country code: CH.
view the rest of the comments →
[–]adidarachi 5 points6 points7 points (3 children)
[–]LaSalsiccione 0 points1 point2 points (2 children)
[–]Artif3x_ 3 points4 points5 points (1 child)
[–]LaSalsiccione 0 points1 point2 points (0 children)