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.

La propriété length, rattachée au prototype de l'objet WebAssembly.Table, renvoie la longueur du tableau WebAssembly, c'est-à-dire le nombre d'éléments qui y sont stockées.

Syntaxe

js
table.length;

Exemples

Avec l'instruction qui suit, on crée un tableau WebAssembly avec une taille initiale de 2 éléments et avec une taille maximale de 10.

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

On peut ensuite étendre le tableau d'un élément :

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

Spécifications

Specification
WebAssembly JavaScript Interface
# dom-table-length

Compatibilité des navigateurs

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

Voir aussi