| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/slice | [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.
This feature is well established and works across many devices and browser versions. Its been available across browsers since 2015 7.
slice() ArrayBuffer ArrayBuffer .
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);
const int32View = new Int32Array(buffer);
// Produces Int32Array [0, 0, 0, 0]
int32View[1] = 42;
const sliced = new Int32Array(buffer.slice(4, 12));
// Produces Int32Array [42, 0]
console.log(sliced[0]);
// Expected output: 42
arraybuffer.slice(begin[, end])
begin0 .
end Optional . ArrayBuffer ArrayBuffer .
slice() end . begin end .
end . ArrayBuffer 0 .
ArrayBuffer const buf1 = new ArrayBuffer(8);
const buf2 = buf1.slice(0);
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-arraybuffer.prototype.slice |
This page was last modified on 2025 6 24 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 |