Resizable buffersBaseline · Newly available
The resize() method of an ArrayBuffer and the grow() method of a SharedArrayBuffer, constructed with the maxByteLength option, changes the size of the buffer in place.
Works in the latest version of every major browser, but older devices may not support it yet. Baseline since Jul 9, 2024.
Browser support
DesktopChrome
1–110Not supported
111+Supportedsince Mar 7, 2023
Current: 155Edge
12–110Not supported
111+Supportedsince Mar 13, 2023
Current: 154Firefox
1–127Not supported
128+Supportedsince Jul 9, 2024
Current: 157Safari
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27MobileChrome Android
18–110Not supported
111+Supportedsince Mar 7, 2023
Current: 155Firefox Android
4–127Not supported
128+Supportedsince Jul 9, 2024
Current: 157Safari iOS
1–16.3Not supported
16.4+Supportedsince Mar 27, 2023
Current: 27How to use
Every current browser supports this, but it only became Baseline on Jul 9, 2024. Use it as a progressive enhancement, or keep a fallback if you support older devices.
Example
Full syntax and examples are on MDN: maxByteLength.
Feature detection
JS · check before using
if ("resizable" in ArrayBuffer || ("prototype" in ArrayBuffer && "resizable" in ArrayBuffer.prototype)) {
// ArrayBuffer.resizable is available
}Sub-features
Support for each part of the feature (8). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| ArrayBuffer.ArrayBuffer.maxByteLength_option | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |
| ArrayBuffer.maxByteLength | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |
| ArrayBuffer.resizable | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |
| ArrayBuffer.resize | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |
| SharedArrayBuffer.SharedArrayBuffer.maxByteLength_option | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |
| SharedArrayBuffer.grow | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |
| SharedArrayBuffer.growable | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |
| SharedArrayBuffer.maxByteLength | 111 | 111 | 128 | 16.4 | 111 | 128 | 16.4 |