WebAssembly.Table.prototype.length

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2017.

lengthWebAssembly.Table オブジェクトのプロトタイププロパティで、このテーブルの長さ、すなわち、テーブルの要素の数を返します。

length の使用

次の例では、新しい WebAssembly Table インスタンスを初期サイズ 2、最大サイズ 10 で作成します。

js
var table = new WebAssembly.Table({
  element: "anyfunc",
  initial: 2,
  maximum: 10,
});

次のようにして、テーブルを 1 ずつ拡大することができます。

js
console.log(table.length); // "2"
console.log(table.grow(1)); // "2"
console.log(table.length); // "3"

仕様書

Specification
WebAssembly JavaScript Interface
# dom-table-length

ブラウザーの互換性

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
length

Legend

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

Full support
Full support

関連情報