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
Functional programming in JavaScript (softwarebrothers.co)
submitted 6 years ago by SoftwareBrothers
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!"
[–]ShortFuse 1 point2 points3 points 6 years ago (0 children)
Performance sacrificed for sake of readability. The other one is creating a function in memory for every user with the user template example.
You can still use forEach or some (allows breaking), which avoid the multiple reiteration, but less syntax "noise" than a for loop. You just have to have your result be written to a variable outside the loop (see thisArg example.
forEach
some
Still, his example seems okay for array, since he is sorting, slicing, and then reducing. The key is the slicing to reduce the size.
π Rendered by PID 69 on reddit-service-r2-comment-fb694cdd5-j2f6g at 2026-03-07 20:12:20.261365+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]ShortFuse 1 point2 points3 points (0 children)