A type-safe wrapper for Array.includes().
Array.includes()
This function acts as a type predicate, narrowing the type of the element after a successful check. It is useful for filtering or validating array contents.
The type of elements in the array.
The read-only array to search within.
The element to search for.
true if the element exists in the array, and narrows the type of el to T.
true
el
T
A type-safe wrapper for
Array.includes().This function acts as a type predicate, narrowing the type of the element after a successful check. It is useful for filtering or validating array contents.