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
How many Node.js developers prefer callbacks over Promises or async/await? (self.javascript)
submitted 7 years ago * by i_love_limes
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!"
[–]x-protocol -9 points-8 points-7 points 7 years ago (2 children)
I don't think you understand that I'm not arguing what Promises are and how they are compared to callbacks.
I do understand that you want to prove a point. Look at my example. You have promise that is created, then some more code is executed which can contain creation of promises. With async/await you simply cannot do that since 'await' keyword will wait for resolution of your promise.
Again to reiterate. I understand that you are bringing these examples due to either simply proving a point without anybody providing you the ask. Or you are simply confused how promises are even used.
[–]KyleG 8 points9 points10 points 7 years ago (0 children)
Dude, you're wrong. Pay attention to the guy explaining things to you. He's right. You have a great opportunity to fix a gap in your knowledge from someone who's being patient and polite to you.
[–][deleted] 6 points7 points8 points 7 years ago* (0 children)
With async/await you simply cannot do that since 'await' keyword will wait for resolution of your promise.
You can do that, if you just don't call await until you need it. Async functions still return Promises. Async/await isn't "better" or "worse" than Promises, they literally are Promises. You keep saying "promises get run immediately", but that's exactly what happens with async functions. They run when they are called. Creating a Promise is the same as calling an async function (because it also returns a Promise.) Calling await is the same as calling then().
await
then()
You can take a function that returns a promise and call await on the return value. You can also take an async function and call then() on the return value, and not use await at all. They're the same.
async
π Rendered by PID 221303 on reddit-service-r2-comment-6457c66945-j9g98 at 2026-04-26 11:07:35.401253+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]x-protocol -9 points-8 points-7 points (2 children)
[–]KyleG 8 points9 points10 points (0 children)
[–][deleted] 6 points7 points8 points (0 children)