WebAssembly.Table.prototype.length
The length
prototype property of the
WebAssembly.Table
object returns the length of the table, i.e. the number
of elements in the table.
Examples
Using length
The following example creates a new WebAssembly Table instance with an initial size of 2 and a maximum size of 10.
var table = new WebAssembly.Table({ element: "anyfunc", initial: 2, maximum: 10 });
You can then grow the table by 1 with the following:
console.log(table.length); // "2"
console.log(table.grow(1)); // "2"
console.log(table.length); // "3"
Specifications
Specification |
---|
WebAssembly JavaScript Interface # dom-table-length |
Browser compatibility
BCD tables only load in the browser