AsyncFunction
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2017.
TheAsyncFunction object provides methods forasync functions. In JavaScript, every async function is actually anAsyncFunction object.
Note thatAsyncFunction isnot a global object. It can be obtained with the following code:
const AsyncFunction = async function () {}.constructor;AsyncFunction is a subclass ofFunction.
In this article
Constructor
AsyncFunction()Creates a new
AsyncFunctionobject.
Instance properties
Also inherits instance properties from its parentFunction.
These properties are defined onAsyncFunction.prototype and shared by allAsyncFunction instances.
AsyncFunction.prototype.constructorThe constructor function that created the instance object. For
AsyncFunctioninstances, the initial value is theAsyncFunctionconstructor.AsyncFunction.prototype[Symbol.toStringTag]The initial value of the
[Symbol.toStringTag]property is the string"AsyncFunction". This property is used inObject.prototype.toString().
Note:AsyncFunction instances do not have theprototype property.
Instance methods
Inherits instance methods from its parentFunction.
Specifications
| Specification |
|---|
| ECMAScript® 2026 Language Specification> # sec-async-function-objects> |