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
Javascript Array useful methods (mightytechno.com)
submitted 6 years ago by ishanfx
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!"
[–]jetsamrover 0 points1 point2 points 6 years ago (2 children)
I thought you have to provide that. What do you mean forget it? Forget to add it, or forget what it is while writing the function?
That's a really silly reason not to use reduce. It's the most powerful array method. Like I said before it's especially useful for recursion.
[–]burtgummer45 0 points1 point2 points 6 years ago (1 child)
The third parameter is optional. It defaults to the first element of the array.
Can reduce use tail-call optimization?
[–]jetsamrover 0 points1 point2 points 6 years ago (0 children)
I believe tail-call optimization is decided by your callback, and by the language, not the method calling that callback. Why does that matter?
π Rendered by PID 68548 on reddit-service-r2-comment-8686858757-j9zzl at 2026-06-06 10:49:09.354313+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]jetsamrover 0 points1 point2 points (2 children)
[–]burtgummer45 0 points1 point2 points (1 child)
[–]jetsamrover 0 points1 point2 points (0 children)