isArrayWith()function

isArrayWith(left: unknown, right: T): left is ImmutableArray<T>
ParamType
leftunknown
The value to check and narrow. required
rightT
The item the array must include. required
Return
left is ImmutableArray<T>
true if left is an array containing right.

Is unknown value left an array that includes right?

Examples

isArrayWith([1, 2, 3], 2) // true