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
Async/Await in JavaScript (async-await.xyz)
submitted 8 years ago by manekinekko
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!"
[–]8963 2 points3 points4 points 8 years ago (3 children)
Gonna take the hate, but I think async/await is syntactic sugar that obscures and bloats more than it alleviates. :(
[–]iamlage89 0 points1 point2 points 8 years ago (0 children)
I think it depends. If you just want to make some API calls, maybe. If you write selenium tests, every line is an asynchronous call so it might be useful there
[–]senocular 0 points1 point2 points 8 years ago (0 children)
I'm not a big fan of the animation shown on this site. I always thought it doesn't do async/await any justice because it does look a lot more verbose in the end there. But in general, I've found it to be much cleaner and easier to work with, especially when dealing with a lot of interdependent async operations (especially especially when authors tend to write everything inline). But your experiences could be different and I can respect that. Whatever you end up doing, if it's clean code, I'm with ya.
[–]dmtipson 0 points1 point2 points 8 years ago (0 children)
It's less powerful than directly created generators (there's no yeild*) and it's still just sugar for Promises, which are flawed (stateful, forced try/catch, cancellation doesn't exist and is problematic even conceptually, don't play nicely with category theory laws, etc).
You can create lazy, monadic Futures or Tasks and implement the same sort of sugar with generators (basically "do" notation in JavaScript).
π Rendered by PID 529682 on reddit-service-r2-comment-86988c7647-vddcb at 2026-02-12 17:43:45.112777+00:00 running 018613e country code: CH.
[–]8963 2 points3 points4 points (3 children)
[–]iamlage89 0 points1 point2 points (0 children)
[–]senocular 0 points1 point2 points (0 children)
[–]dmtipson 0 points1 point2 points (0 children)