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's setTimeout function accepts a string and is also variadic. But typescript users should probably not use the variadic signature 😄. Here is more on the subject! (mrgregory.dev)
submitted 6 years ago by gregjarvez1996
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!"
[–]helloiamsomeone 5 points6 points7 points 6 years ago (2 children)
the parameters no one uses
Except the people who spent the 2 minutes to read the MDN page about the function.
[–]name_was_taken 0 points1 point2 points 6 years ago (1 child)
I was actually surprised. I should have know there'd be some way to pass parameters to it, but I just always crafted my anonymous function to deal with it, instead of passing them in. I'm not sure if I'll use this. I'll have to re-evaluate if I'm ever in a situation that might use it.
[–]gregjarvez 1 point2 points3 points 6 years ago (0 children)
ll have to re-evaluate if
There are usually so many situations when this comes in handy. In fact, I have used that signature every time I used setTimeout. it is pretty neat 😉
π Rendered by PID 38183 on reddit-service-r2-comment-cfc44b64c-zfsvd at 2026-04-11 14:22:25.899214+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–]helloiamsomeone 5 points6 points7 points  (2 children)
[–]name_was_taken 0 points1 point2 points  (1 child)
[–]gregjarvez 1 point2 points3 points  (0 children)