isArray

function isArray(val): val is unknown[]

Returns true if the specified value is an array.

This is safer than using Array.isArray directly because it doesn't introduce an any type.

Parameters

ParameterTypeDescription
valunknownVariable to test.

Returns

val is unknown[]

Whether variable is an array.