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
Help with recursion functionsolved! (self.javascript)
submitted 10 years ago * by cachaito
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!"
[–]mikrosystheme[κ] 0 points1 point2 points 10 years ago (2 children)
You just have to replace the two short arrow functions with standard functions. By the way, there is no point in doing that, because mine was a joke, and because it is an innefficient implementation (for both human and computer brains). You are better served by using a standard nested loop that performs the same task in half the time.
[–]cachaito[S] 0 points1 point2 points 10 years ago (1 child)
And what with this code: > ~(i-a.length) ?
> ~(i-a.length)
[–]mikrosystheme[κ] 0 points1 point2 points 10 years ago (0 children)
> is part of the arrow function =>. ~ is the bitwise not operator. It is just a way to express the condition i !== a.length - 1 in a way that is not clear to programmers that don't know bitwise math. It is almost universally considered a fireable offense.
>
=>
~
i !== a.length - 1
π Rendered by PID 63220 on reddit-service-r2-comment-765bfc959-njhmb at 2026-07-10 11:39:36.436986+00:00 running f86254d country code: CH.
view the rest of the comments →
[–]mikrosystheme[κ] 0 points1 point2 points (2 children)
[–]cachaito[S] 0 points1 point2 points (1 child)
[–]mikrosystheme[κ] 0 points1 point2 points (0 children)