Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. JavaScript
  3. Reference
  4. Standard built-in objects
  5. ArrayBuffer
  6. isView()

ArrayBuffer.isView()

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

TheArrayBuffer.isView() static method determines whether thepassed value is one of theArrayBuffer views,such astyped array objectsor aDataView.

Try it

// Create an ArrayBuffer with a size in bytesconst buffer = new ArrayBuffer(16);console.log(ArrayBuffer.isView(new Int32Array()));// Expected output: true

Syntax

js
ArrayBuffer.isView(value)

Parameters

value

The value to be checked.

Return value

true if the given argument is one of theArrayBuffer views;otherwise,false.

Examples

Using isView

js
ArrayBuffer.isView(); // falseArrayBuffer.isView([]); // falseArrayBuffer.isView({}); // falseArrayBuffer.isView(null); // falseArrayBuffer.isView(undefined); // falseArrayBuffer.isView(new ArrayBuffer(10)); // falseArrayBuffer.isView(new Uint8Array()); // trueArrayBuffer.isView(new Float32Array()); // trueArrayBuffer.isView(new Int8Array(10).subarray(0, 3)); // trueconst buffer = new ArrayBuffer(2);const dv = new DataView(buffer);ArrayBuffer.isView(dv); // true

Specifications

Specification
ECMAScript® 2026 Language Specification
# sec-arraybuffer.isview

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp