jskatas.org Continuously Learn JavaScript. Your Way.

Async Function: basics

Donate to NGO Julenka. Support Ukranians in need. Julenka is an NGO which my brother founded in 2011 to support Ukranian families and kids in need.

can be created by putting async before

  • a function expression
  • a function declaration
  • an arrow function
  • an object method

the return value

  • is always a Promise
  • wraps the return value in a Promise
  • is a rejected Promise when the async function throws

Links

A short description of async function.
The actual chapter about `async`, you need to dive in from here.