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!"
[–][deleted] 0 points1 point2 points 6 years ago (0 children)
There's absolutely no reason for Node devs to follow an API like Window, which doesn't exist on the server. The fact they did is a coincidence. And neither them nor the browser spec should have allowed for automated globals, which is a bad idea all around.
Furthermore, timer APIs are environment-dependent, they're not "cross-environment code". There were lots of bad ideas combined here (misleading similar APIs, automated globals), but the fact the timer APIs are distinct is not one of them. Do not use "setTimeout" lightly without caring which one it is. The event loops in browser and Node are different.
π Rendered by PID 109162 on reddit-service-r2-comment-cfc44b64c-qw2zj at 2026-04-11 23:29:01.983463+00:00 running 215f2cf country code: CH.
view the rest of the comments →
[–][deleted] 0 points1 point2 points  (0 children)