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.

Syntax

table.length;

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
The definition of 'length' in that specification.

Browser compatibility

DesktopMobileServer
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung InternetNode.js
lengthChrome Full support 57Edge Full support 16Firefox Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
IE No support NoOpera Full support 44Safari Full support 11WebView Android Full support 57Chrome Android Full support 57Firefox Android Full support 52
Notes
Full support 52
Notes
Notes Disabled in the Firefox 52 Extended Support Release (ESR).
Opera Android Full support 43Safari iOS Full support 11Samsung Internet Android Full support 7.0nodejs Full support 8.0.0

Legend

Full support
Full support
No support
No support
See implementation notes.
See implementation notes.

See also