Variable: isArray
constisArray:TypePredicate<unknown,unknown[]>
Defined in: predicate/guards/index.ts:248
Type guard that checks if a value is an array.
Param
The value to check
Returns
True if value is an array
Example
import { isArray } from 'receta/predicate'
const value: unknown = [1, 2, 3]
if (isArray(value)) {
console.log(value.length) // TypeScript knows value is array
}
See
- isObject - for object type guard
- isFunction - for function type guard