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.

Die schreibgeschützte length Prototypeigenschaft des WebAssembly.Table-Objekts gibt die Länge der Tabelle zurück, d.h. die Anzahl der Elemente in der Tabelle.

Beispiele

Verwendung von length

Das folgende Beispiel erstellt eine neue WebAssembly-Tabelle mit einer anfänglichen Größe von 2 und einer maximalen Größe von 10:

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

Erweitern Sie die Tabelle um 1 mit WebAssembly.grow():

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

Spezifikationen

Specification
WebAssembly JavaScript Interface
# dom-table-length

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
length

Legend

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

Full support
Full support

Siehe auch