Syntax

Parameters

The function name. Can be omitted, in which case the function is anonymous. The name is only local to the function body.

paramN

The name of an argument to be passed to the function.

statements

The statements which comprise the body of the function.

Description

An async function expression is very similar to, and has almost the same syntax as, an async function statement. The main difference between an async function expression and an async function statement is the function name, which can be omitted in async function expressions to create anonymous functions. An async function expression can be used as an IIFE (Immediately Invoked Function Expression) which runs as soon as it is defined. See also the chapter about functions for more information.