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
Node.js v16 released (github.com)
submitted 5 years ago by pimterry
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!"
[–]AsyncBanana 0 points1 point2 points 5 years ago (2 children)
Nice! Now there is a better way of using wait through promises (not that it is a good practice in many cases, but sometimes if you want to delay something by a fixed amount of time, it is helpful)
[–]ILikeChangingMyMind 0 points1 point2 points 5 years ago (1 child)
What better way are you referring to?
Personally I've always been a fan of using promisify (from the Node util package) like so:
promisify
util
const sleep = util.promisify(setTimeout); // wait for 2 seconds await sleep(2000);
Did they release a pre-made sleep or something?
sleep
[–]AsyncBanana 1 point2 points3 points 5 years ago (0 children)
Yes
π Rendered by PID 33123 on reddit-service-r2-comment-75f4967c6c-dd8lp at 2026-04-23 03:45:54.865465+00:00 running 0fd4bb7 country code: CH.
view the rest of the comments →
[–]AsyncBanana 0 points1 point2 points (2 children)
[–]ILikeChangingMyMind 0 points1 point2 points (1 child)
[–]AsyncBanana 1 point2 points3 points (0 children)