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.

Das AsyncFunction-Objekt bietet Methoden für asynchrone Funktionen. In JavaScript ist jede asynchrone Funktion tatsächlich ein AsyncFunction-Objekt.

Beachten Sie, dass AsyncFunction kein globales Objekt ist. Es kann mit folgendem Code erhalten werden:

js
const AsyncFunction = async function () {}.constructor;

AsyncFunction ist eine Unterklasse von Function.

Konstruktor

AsyncFunction()

Erstellt ein neues AsyncFunction-Objekt.

Instanz-Eigenschaften

Erbt auch Instanz-Eigenschaften von seinem Elternteil Function.

Diese Eigenschaften sind auf AsyncFunction.prototype definiert und werden von allen AsyncFunction-Instanzen geteilt.

AsyncFunction.prototype.constructor

Die Konstruktorfunktion, die das Instanzobjekt erstellt hat. Für AsyncFunction-Instanzen ist der anfängliche Wert der AsyncFunction-Konstruktor.

AsyncFunction.prototype[Symbol.toStringTag]

Der anfängliche Wert der [Symbol.toStringTag]-Eigenschaft ist der String "AsyncFunction". Diese Eigenschaft wird in Object.prototype.toString() verwendet.

Note: AsyncFunction-Instanzen haben nicht die prototype-Eigenschaft.

Instanzmethoden

Erbt Instanzmethoden von seinem Elternteil Function.

Spezifikationen

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

Browser-Kompatibilität

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
AsyncFunction
AsyncFunction() constructor

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support

Siehe auch