WebAssembly.Table.prototype.length

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

length の使用

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

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

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

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

仕様書

Specification
WebAssembly JavaScript Interface
# dom-table-length

ブラウザーの互換性

BCD tables only load in the browser

関連情報