| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/resize | [Back] [Original] |
Get to know MDN better
This page was translated from English by the community. Learn more and join the MDN Web Docs community.
Since 2024 7, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.
ArrayBuffer resize() ArrayBuffer .
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
console.log(buffer.byteLength);
// Expected output: 8
buffer.resize(12);
console.log(buffer.byteLength);
// Expected output: 12
resize(newLength)
newLength ArrayBuffer .
(undefined).
TypeErrorArrayBuffer .
RangeErrorArrayBuffer maxByteLength newLength .
resize() ArrayBuffer resizable ArrayBuffer maxByteLength newLength ArrayBuffer . 0 .
resize() ArrayBuffer . newLength ArrayBuffer byteLength .
16 8 resizable resizable true .
const buffer = new ArrayBuffer(8, { maxByteLength: 16 });
if (buffer.resizable) {
console.log("Buffer is resizable!");
buffer.resize(12);
}
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-arraybuffer.prototype.resize |
This page was last modified on 2025 2 11 by MDN contributors.
ArrayBufferObject/FunctionObject.prototype.__defineGetter__()Object.prototype.__defineSetter__()Object.prototype.__lookupGetter__()Object.prototype.__lookupSetter__()Object.prototype.hasOwnProperty()Object.prototype.isPrototypeOf()Object.prototype.propertyIsEnumerable()Object.prototype.toLocaleString()Object.prototype.toString()Object.prototype.valueOf()Your blueprint for a better internet.
Portions of this content are 19982026 by individual mozilla.org contributors. Content available under a Creative Commons license.
| Web Proxy Viewer | New URL | Original Page |