MDN will be in maintenance mode on Friday September 22nd, starting at 10 AM Pacific / 5 PM UTC, for about 1 hour.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The grow() prototype method of the WebAssembly.Table object increases the size of the Table instance by a specified number of elements.

Syntax

table.grow(number);

Parameters

number
The number of elements you want to grow the table by.

Return value

The previous length of the table.

Exceptions

If the grow() operation fails for whatever reason, a RangeError is thrown.

Examples

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 Status Comment
Web Assembly JavaScript API
The definition of 'grow()' in that specification.
Draft Initial draft definition.

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic Support5716522 No4411
FeatureAndroidChrome for AndroidEdge mobileFirefox for AndroidIE mobileOpera AndroidiOS Safari
Basic Support5757 (Yes)1522 No ?11

1. , this feature is behind the Experimental JavaScript Features preference.

2. Disabled in the Firefox 52 Extended Support Release (ESR).

See also

Document Tags and Contributors

 Contributors to this page: fscholz, chrisdavidmills, lukewagner
 Last updated by: fscholz,