O'Reilly logo

Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond by JD Isaacks

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Lesson 32. Async functions

After reading lesson 32, you will be able to

  • Write asynchronous code using a synchronous syntax
  • Use generators to write asynchronous code
  • Use asynchronous functions to write asynchronous code

One of the reasons JavaScript can be hard to learn is because of its asynchronous nature. Asynchronous code is hard to think about, but it’s this asynchronous nature that makes JavaScript such a great language for the web. Web applications are full of asynchronous actions—from loading assets to handling user input. The purpose of asynchronous functions is to make it easy to write and think about asynchronous code.

Consider this

So far in this unit we’ve been dealing with promises, which have proven to be much more ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required