| [ Web Proxy ] |
| Viewing: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView | [Back] [Original] |
Get to know MDN better
This feature is well established and works across many devices and browser versions. Its been available across browsers since July 2015.
The ArrayBuffer.isView() static method determines whether the
passed value is one of the ArrayBuffer views,
such as typed array objects
or a DataView.
// Create an ArrayBuffer with a size in bytes
const buffer = new ArrayBuffer(16);
console.log(ArrayBuffer.isView(new Int32Array()));
// Expected output: true
ArrayBuffer.isView(value)
valueThe value to be checked.
true if the given argument is one of the ArrayBuffer views;
otherwise, false.
ArrayBuffer.isView(); // false
ArrayBuffer.isView([]); // false
ArrayBuffer.isView({}); // false
ArrayBuffer.isView(null); // false
ArrayBuffer.isView(undefined); // false
ArrayBuffer.isView(new ArrayBuffer(10)); // false
ArrayBuffer.isView(new Uint8Array()); // true
ArrayBuffer.isView(new Float32Array()); // true
ArrayBuffer.isView(new Int8Array(10).subarray(0, 3)); // true
const buffer = new ArrayBuffer(2);
const dv = new DataView(buffer);
ArrayBuffer.isView(dv); // true
| Specification |
|---|
| ECMAScript 2027 LanguageSpecification # sec-arraybuffer.isview |
This page was last modified on Jul 10, 2025 by MDN contributors.
ArrayBufferObject/FunctionYour 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 |