The grow()
prototype method of the WebAssembly.Table
object increases the size of the Table instance by a specified number of elements.
table.grow(number);
The previous length of the table.
If the grow()
operation fails for whatever reason, a RangeError
is thrown.
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"
Specification | Status | Comment |
---|---|---|
WebAssembly JavaScript Interface The definition of 'grow()' in that specification. | Working Draft | Initial draft definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | 57 | 16 | 52
|
No | 44 | 11 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | 57 | 57 | Yes
|
52
|
? | 11 | 7.0 |
Server | |
---|---|
Node.js | |
Basic support | 8.0.0 |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Table/grow