At work last week, the new Async/Await syntax caught my eye, prompting me to point like an eager five-year-old at some new and shiny thing: “Wait, what’s that?!”
As far as I’m concerned, a few months ago, all the cool kids were still chaining promises and using “catch” functions to structure their asynchronous API calls in JavaScript. Now, with ES7, we can simplify our code even more, which blows my mind.
Patrick Triest does a great job of explaining how Async/Await works in his article, which you can find here. He gives an overview how we’ve handled asynchronicity in JS over time, which is pretty cool, and provides some great code examples. He lays out clearly what works, what doesn’t, and how we can still do better.
If you’re a JavaScript developer, be sure to check it out!