Async: Await

Makes JavaScript wait until that promise settles and returns its result.

The await keyword before a promise makes JavaScript wait until that promise settles, and then.

Syntax

// works only inside async functions
let value = await promise;
If it's an error, the exception is generated, same as if throw error were called at that very place.
Otherwise, it returns the result, so we can assign it to a value.

Related concepts

Async: Await — Structure map

Clickable & Draggable!

Async: Await — Related pages: