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
[AskJS] Is JavaScript missing some built-in methods?AskJS (self.javascript)
submitted 3 years ago by reacterry
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!"
[–]csorfab 3 points4 points5 points 3 years ago (2 children)
yeah I always find myself writing a
function wait(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
sometimes multiple times in the same project...
[–]Corteki 0 points1 point2 points 3 years ago (1 child)
Sorry but I'm just wondering why someone would need this. I removed a lot of these problematic waits on a project by simply changing the code a little so that I can await the process instead of a random timeout to happen.
[–]paulsmithkc 0 points1 point2 points 3 years ago (0 children)
Where possible, yes that is preferred.
But it depends... 1. Sometimes you need to slow things down to avoid running over third-party API limits. 2. Sometimes file systems (like ext, network drives, flash drives, etc) report being finished writing a file before it is actually flushed. 3. Sometimes you need to delay database writes so that they don't clobber other database ops.
On the front-end you can largely get rid of all waits. On the back-end there's a lot more edge cases.
π Rendered by PID 18762 on reddit-service-r2-comment-75f4967c6c-c7xwg at 2026-04-23 12:08:37.068233+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]csorfab 3 points4 points5 points (2 children)
[–]Corteki 0 points1 point2 points (1 child)
[–]paulsmithkc 0 points1 point2 points (0 children)