For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /reference/predicate/isTypedArray.md.

isTypedArray es-toolkit

Checks if a given value is a TypedArray instance.

const result = isTypedArray(value);

Usage

isTypedArray(value)

Use isTypedArray when you want to check if a value is a TypedArray instance.

import { isTypedArray } from 'es-toolkit/predicate';

// TypedArray instances
const uint8 = new Uint8Array([1, 2, 3]);
const int16 = new Int16Array([1000, 2000]);
const float32 = new Float32Array([1.5, 2.5]);
const bigUint64 = new BigUint64Array([1n, 2n]);

console.log(isTypedArray(uint8)); // true
console.log(isTypedArray(int16)); // true
console.log(isTypedArray(float32)); // true
console.log(isTypedArray(bigUint64)); // true

// Non-TypedArray values
console.log(isTypedArray([1, 2, 3])); // false (regular array)
console.log(isTypedArray(new ArrayBuffer(8))); // false (ArrayBuffer)
console.log(isTypedArray(new DataView(new ArrayBuffer(8)))); // false (DataView)
console.log(isTypedArray({})); // false
console.log(isTypedArray(null)); // false
console.log(isTypedArray(undefined)); // false

Parameters

valueunknownrequired

The value to check if it's a TypedArray instance.

Returns

Returns true if the value is a TypedArray instance, false otherwise.

value is Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | BigUint64Array | Int8Array | Int16Array | Int32Array | BigInt64Array | Float32Array | Float64Array
Source: es-toolkit

Re-exported verbatim from es-toolkit. Implementation, edge cases, and performance behavior are owned upstream. This page mirrors the documentation at the pinned version; the linked source is authoritative.