O'Reilly logo

Learning ECMAScript 6 by Narayan Prusty

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

Promises to the rescue

ES6 introduces a new native pattern for writing the asynchronous code called as Promise pattern.

This new pattern removes the common code issues that the event and callback pattern had. It also makes the code look more like a synchronous code.

A Promise (or a Promise object) represents an asynchronous operation. The existing asynchronous JavaScript APIs are usually wrapped with Promises, and the new JavaScript APIs are being purely implemented using the Promises.

Promises are new in JavaScript but are already present in many other programming languages. Programming Languages such as C# 5, C++ 11, Swift, Scala, and more are some examples that support Promises.

ES6 provides the Promise API using which we can create Promises and ...

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