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.
The read-only 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:
js
const table = new WebAssembly.Table({
element: "anyfunc",
initial: 2,
maximum: 10,
});
Grow the table by 1 using WebAssembly.grow()
:
js
console.log(table.length); // 2
table.grow(1);
console.log(table.length); // 3
Specifications
Specification |
---|
WebAssembly JavaScript Interface # dom-table-length |
Browser compatibility
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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.