Six reasons why JavaScript’s async/await blows promises away

Home » Javascript » Six reasons why JavaScript’s async/await blows promises away
April 18, 2017 Javascript No Comments

In the JavaScript world promises are a great way to deal with stuff that needs to happen asynchronously. But there’s also another new way to go about it: async/await.

In case you missed it, Node now supports async/await out of the box since version 7.6. If you haven’t tried it yet, here are a bunch of reasons with examples why you should adopt it immediately and never look back.

For those who have never heard of this topic before, here’s a quick intro
– Async/await is a new way to write asynchronous code. Previous options for asynchronous code are callbacks and promises.
– Async/await is actually built on top of promises. It cannot be used with plain callbacks or node callbacks.
– Async/await is, like promises, non blocking.
– Async/await makes asynchronous code look and behave a little more like synchronous code. This is where all its power lies.

https://hackernoon.com/6-reasons-why-javascripts-async-await-blows-promises-away-tutorial-c7ec10518dd9

LEAVE A COMMENT