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
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
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
length |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support