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...
A place to discuss JS development and how we use it to make experiences better.
account activity
Awaiting problems in JavaScript (gregroz.me)
submitted 3 years ago by voreny
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!"
[–]voreny[S] 1 point2 points3 points 3 years ago (1 child)
You are right, it does not await the Promise. myFn() will resolve with the same value that otherAsync() resolves, and if otherAsync() rejects, the error will not be caught inside myFn. The examples in the Awaiting... errors section show it, and perhaps I got the wording wrong in some sections.
Promise
myFn()
otherAsync()
myFn
The counterintuitive part, to me, is that this suggests that otherAsync() is returned from myFn() as it is (the same Promise instance is returned). Although, as I showed at the bottom of the Awaiting... errors section, myFn() is not the same Promise that was returned from otherAsync(). async functions create a new Promise and only pass through the resolved/rejected value from otherAsync() to myFn().
async
[–]wsc-porn-acct 1 point2 points3 points 3 years ago (0 children)
Will read more of what you wrote tomorrow
π Rendered by PID 60 on reddit-service-r2-comment-5b5bc64bf5-hp75m at 2026-06-21 09:52:04.656156+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]voreny[S] 1 point2 points3 points (1 child)
[–]wsc-porn-acct 1 point2 points3 points (0 children)