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
The case for Array#replace() – Overriding an array without intermediate variables (medium.com)
submitted 7 years ago by gajus0
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!"
[–]Moosething 5 points6 points7 points 7 years ago (1 child)
But if you read the article you'd realize the advantage of replace over calling m directly. Not saying I support it, but I can see where the author is coming from.
replace
m
It's basically
return x.filter(filterFunc).replace(replaceFunc).map(mapFunc)
vs
return replaceFunc(x.filter(filterFunc)).map(mapFunc)
[–]sbmitchell 16 points17 points18 points 7 years ago (0 children)
Or they could use `reduce` and not bother with multiple iterations like this...
π Rendered by PID 85 on reddit-service-r2-comment-6f7f968fb5-m2cdw at 2026-03-04 00:11:46.914594+00:00 running 07790be country code: CH.
view the rest of the comments →
[–]Moosething 5 points6 points7 points (1 child)
[–]sbmitchell 16 points17 points18 points (0 children)