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.

AsyncFunction オブジェクトは、非同期関数のメソッドを提供します。JavaScript では、すべての非同期関数が実際に AsyncFunction オブジェクトです。

AsyncFunction はグローバルオブジェクトではないことに注意してください。これは以下のようなコードで取得することができます。

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

AsyncFunctionFunction のサブクラスです。

コンストラクター

AsyncFunction()

新しい AsyncFunction オブジェクトを生成します。

インスタンスプロパティ

インスタンスプロパティを親である Function から継承しています

これらのプロパティは AsyncFunction.prototype で定義されており、すべての AsyncFunction のインスタンスで共有されます。

AsyncFunction.prototype.constructor

インスタンスオブジェクトを作成したコンストラクター関数。AsyncFunction インスタンスの場合、初期値は AsyncFunction コンストラクターです。

AsyncFunction.prototype[@@toStringTag]

@@toStringTag プロパティの初期値は、文字列 "AsyncFunction" です。このプロパティは Object.prototype.toString() で使用されます。

メモ: AsyncFunction のインスタンスには prototype プロパティがありません。

インスタンスメソッド

インスタンスメソッドを親である Function から継承しています

仕様書

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

ブラウザーの互換性

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

関連情報