Spec-Zone.ru › JavaScript

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.

The AsyncFunction object provides methods for async functions. In JavaScript, every async function is actually an AsyncFunction object.

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.

Constructor

AsyncFunction()
Creates a new AsyncFunction object.

Instance properties

Also inherits instance properties from its parent Function.

These properties are defined on AsyncFunction.prototype and shared by all AsyncFunction instances.

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().

Note: AsyncFunction instances do not have the prototype property.

Instance methods

Inherits instance methods from its parent Function.

Specifications

Specification
ECMAScript® 2027 Language Specification
# sec-async-function-objects

Browser compatibility

Desktop Mobile Server
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on iOS Samsung Internet WebView Android WebView on iOS Bun Deno Node.js
AsyncFunction
55
15
52
42
10.1
55
52
42
10.3
6.0
55
10.3
1.0.0
1.0
7.6.0
AsyncFunction
55
15
52
42
10.1
55
52
42
10.3
6.0
55
10.3
1.0.0
1.0
7.6.0

See also

  • async function
  • async function expression
  • Function
  • AsyncGeneratorFunction
  • GeneratorFunction
  • Functions

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncFunction

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API