isJSONArray es-toolkit
Checks if a value is a valid JSON array.
Usage
isJSONArray(value)
Use isJSONArray when you want to check if all elements of an array are valid JSON values. A valid JSON array is an array consisting only of values that can be JSON-serialized (null, objects, arrays, strings, numbers, booleans).
Distinguishes from invalid JSON arrays:
Useful for API response validation or pre-serialization data verification.
Returns false for arrays with functions as elements or objects like TypedArray that cannot be JSON-serialized.
Parameters
The value to check if it's a valid JSON array.
Returns
Returns true if the value is a valid JSON array, false otherwise.
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.