Skip to content

isArrayBuffer

Checks if the provided value is an ArrayBuffer.

Syntax

typescript
isArrayBuffer(input: unknown): input is ArrayBuffer

Parameters

NameTypeDescription
inputunknownThe value to be checked

Returns

TypeDescription
booleanReturns true if the value is an ArrayBuffer, otherwise false

Example

typescript
isArrayBuffer(new ArrayBuffer(8)); // true
isArrayBuffer([]); // false
isArrayBuffer(null); // false

Notes

  • Uses object type checking and the internal signature [object ArrayBuffer].

References

Released under the MIT License.