WebAssembly.Table.prototype.length
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
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.
var table = new WebAssembly.Table({ element: "anyfunc", initial: 2, maximum: 10 });
On peut ensuite étendre le tableau d'un élément :
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
BCD tables only load in the browser