TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Upgrading to Async/Await with JavaScript ES7

4 pointsby bbrennanover 7 years ago

1 comment

hdhzyover 7 years ago
Async await while looking nice compared to bare callbacks and Promises are still not without drawbacks. For example one cannot use await inside nested callback so it&#x27;s in async functions it&#x27;s necessary to use for-of and avoid forEach when dealing with Promise values.<p>* <a href="http:&#x2F;&#x2F;journal.stuffwithstuff.com&#x2F;2015&#x2F;02&#x2F;01&#x2F;what-color-is-your-function&#x2F;" rel="nofollow">http:&#x2F;&#x2F;journal.stuffwithstuff.com&#x2F;2015&#x2F;02&#x2F;01&#x2F;what-color-is-y...</a><p>* <a href="https:&#x2F;&#x2F;spion.github.io&#x2F;posts&#x2F;es7-async-await-step-in-the-wrong-direction.html" rel="nofollow">https:&#x2F;&#x2F;spion.github.io&#x2F;posts&#x2F;es7-async-await-step-in-the-wr...</a><p>Current solution is just an evolutionary change merging generators and Promises.
评论 #15395114 未加载