isInArray()function
isInArray(left: unknown, right: ImmutableArray<R>): left is R
| Param | Type | |
|---|---|---|
left | unknown | The value to look for and narrow. required |
right | ImmutableArray<R> | The array to search within. required |
| Return | |
|---|---|
left is R | true if left is an item of right. |
Is unknown value left in array right?
Examples
isInArray(2, [1, 2, 3]) // true