TypeScript: New Features

A quick introduction to “Promises” and “Async/Await” (with new features)

In this lesson, we are going to learn about ES6 Promises implementation in TypeScript and async/await syntax.

Uday Hiwarale
JsPoint
Published in
10 min readAug 1, 2020

--

(source: unsplash.com)

Promises are one of the newest features introduced in the JavaScript language. Since I have another article just on Promises and Async/Await syntax in JavaScript, I am just going to focus on how Promises are implemented in TypeScript.

💡 Please follow this above article to know more about how Promises work under the hood in the JavaScript engine. Having the knowledge Promises absolutely necessary to make sense of whatever we are going to talk about in this lesson.

A promise is an instance (object) of the Promise class (constructor). To create a promise, we use new Promise(executor) syntax and provide an executor function as an argument. This executor function provides a means to control the behavior of our promise resolution or rejection.

--

--