HTML: Markup language
CSS: Styling language
JavaScript: Scripting language
Web APIs: Programming interfaces
All web technology
Learn web development
Discover our tools
Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since April 2017.
The AsyncFunction object provides methods for async functions. In JavaScript, every async function is actually an AsyncFunction object.
AsyncFunction
Note that AsyncFunction is not a global object. It can be obtained with the following code:
const AsyncFunction = async function () {}.constructor;
AsyncFunction is a subclass of Function.
Function
AsyncFunction()
Creates a new AsyncFunction object.
Also inherits instance properties from its parent Function.
These properties are defined on AsyncFunction.prototype and shared by all AsyncFunction instances.
AsyncFunction.prototype
AsyncFunction.prototype.constructor
The constructor function that created the instance object. For AsyncFunction instances, the initial value is the AsyncFunction constructor.
AsyncFunction.prototype[Symbol.toStringTag]
The initial value of the [Symbol.toStringTag] property is the string "AsyncFunction". This property is used in Object.prototype.toString().
[Symbol.toStringTag]
"AsyncFunction"
Object.prototype.toString()
Note: AsyncFunction instances do not have the prototype property.
prototype
Inherits instance methods from its parent Function.
Enable JavaScript to view this browser compatibility table.
async function
AsyncGeneratorFunction
GeneratorFunction