Skip to main content
types.isArrayBufferView - node__util.d.ts - Node documentation
function types.isArrayBufferView

Usage in Deno

```typescript import { types } from "node:node__util.d.ts"; ```
isArrayBufferView(object: unknown): object is ArrayBufferView
Returns `true` if the value is an instance of one of the [`ArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer) views, such as typed array objects or [`DataView`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView). Equivalent to [`ArrayBuffer.isView()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer/isView). ```js util.types.isArrayBufferView(new Int8Array()); // true util.types.isArrayBufferView(Buffer.from('hello world')); // true util.types.isArrayBufferView(new DataView(new ArrayBuffer(16))); // true util.types.isArrayBufferView(new ArrayBuffer()); // false ```

Parameters

object: unknown

Return Type

object is ArrayBufferView