HTTP/2 200
via: 1.1 google, 1.1 varnish, 1.1 varnish, 1.1 varnish, 1.1 varnish
x-goog-stored-content-length: 155320
server: Google Frontend
content-type: text/html
x-goog-generation: 1766970566244064
x-guploader-uploadid: AHVrFxP_7zgCXrHrhVagMdwPYmfU_GC_4PmNqpPfLIW_DFU8lzi5shTIt96EFhDeRIkG_4Z0IQY7DKw
cache-control: public, max-age=3600
x-frame-options: DENY
x-goog-storage-class: STANDARD
etag: "f024d927a30e6911b9cfefb1374d93f6"
strict-transport-security: max-age=63072000
x-goog-hash: crc32c=Sb7k/A==, md5=8CTZJ6MOaRG5z++xN02T9g==
content-security-policy: default-src 'self'; script-src 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; script-src-elem 'report-sample' 'self' 'wasm-unsafe-eval' https://www.google-analytics.com/analytics.js https://*.googletagmanager.com assets.codepen.io production-assets.codepen.io https://js.stripe.com 'sha256-XNBp89FG76amD8BqrJzyflxOF9PaWPqPqvJfKZPCv7M=' 'sha256-YCNoU9DNiinACbd8n6UPyB/8vj0kXvhkOni9/06SuYw=' 'sha256-PZjP7OR6mBEtnvXIZfCZ5PuOlxoDF1LDZL8aj8c42rw='; style-src 'report-sample' 'self' 'unsafe-inline'; object-src 'none'; base-uri 'self'; connect-src 'self' developer.allizom.org bcd.developer.allizom.org bcd.developer.mozilla.org updates.developer.allizom.org updates.developer.mozilla.org https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com https://incoming.telemetry.mozilla.org https://observatory-api.mdn.allizom.net https://observatory-api.mdn.mozilla.net https://api.github.com/search/issues stats.g.doubleclick.net https://api.stripe.com; font-src 'self'; frame-src 'self' mdn.github.io *.mdnplay.dev *.mdnyalp.dev *.play.test.mdn.allizom.net https://v2.scrimba.com https://scrimba.com jsfiddle.net www.youtube-nocookie.com codepen.io survey.alchemer.com https://js.stripe.com; img-src 'self' data: *.githubusercontent.com *.googleusercontent.com *.gravatar.com mozillausercontent.com firefoxusercontent.com profile.stage.mozaws.net profile.accounts.firefox.com developer.mozilla.org mdn.dev wikipedia.org upload.wikimedia.org https://mdn.github.io/shared-assets/ https://mdn.dev/ https://*.google-analytics.com https://*.googletagmanager.com www.gstatic.com; manifest-src 'self'; media-src 'self' archive.org videos.cdn.mozilla.net https://mdn.github.io/shared-assets/; child-src 'self'; worker-src 'self';
x-goog-meta-goog-reserved-file-mtime: 1766969646
x-goog-stored-content-encoding: identity
x-cloud-trace-context: f34eef4271064935eb80bfd406d34a08
last-modified: Mon, 29 Dec 2025 01:09:26 GMT
expires: Mon, 29 Dec 2025 20:00:06 GMT
referrer-policy: strict-origin-when-cross-origin
x-content-type-options: nosniff
x-goog-metageneration: 1
origin-trial: AxVILwizhbMjxFeHOn1P3R8niO1RJY/smaK4B4d1rLzc1gTaxtXMSaTi+FoigYgCw40uFRDwFcEAeqDR+vVLOW4AAABfeyJvcmlnaW4iOiJodHRwczovL2RldmVsb3Blci5tb3ppbGxhLm9yZyIsImZlYXR1cmUiOiJQcml2YXRlQXR0cmlidXRpb25WMiIsImV4cGlyeSI6MTc0MjA3OTYwMH0=
content-encoding: gzip
accept-ranges: bytes
age: 0
date: Mon, 29 Dec 2025 20:37:27 GMT
x-served-by: cache-bfi-kbfi7400095-BFI, cache-bfi-kbfi7400100-BFI, cache-sin-wsss1830099-SIN, cache-bom-vanm7210056-BOM
x-cache: MISS, HIT, MISS, MISS
x-cache-hits: 0, 0, 0, 0
x-timer: S1767040648.704844,VS0,VE294
vary: Accept-Encoding
content-length: 20394
TypedArray.prototype.subarray() - JavaScript | MDN
const uint8 = new Uint8Array([10, 20, 30, 40, 50]);
console.log(uint8.subarray(1, 3));
// Expected output: Uint8Array [20, 30]
console.log(uint8.subarray(1));
// Expected output: Uint8Array [20, 30, 40, 50]
subarray()
subarray(begin)
subarray(begin, end)
begin Optional
Element to begin at. The offset is inclusive. The whole array will be included in
the new view if this value is not specified.
end Optional
Element to end at. The offset is exclusive. If not specified, all elements from the
one specified by begin to the end of the array are included in
the new view.
The range specified by begin and end is
clamped to the valid index range for the current array; if the computed length of the
new array would be negative, it's clamped to zero. If either
begin or end is negative, it refers to
an index from the end of the array instead of from the beginning.
Also note that this is creating a new view on the existing buffer; changes to the new
object's contents will impact the original object and vice versa.
const buffer = new ArrayBuffer(8);
const uint8 = new Uint8Array(buffer);
uint8.set([1, 2, 3]);
console.log(uint8); // Uint8Array [ 1, 2, 3, 0, 0, 0, 0, 0 ]
const sub = uint8.subarray(0, 4);
console.log(sub); // Uint8Array [ 1, 2, 3, 0 ]
Enable JavaScript to view this browser compatibility table.