Function: includes()
Returns true
if any value of iterable
is equal to searchElement
using
Object.is
. Otherwise returns false
.
Like Array.prototype.includes
, but for iterables.
Example
import { includes, pipe } from 'lfi'
console.log(
pipe(
[`sloth`, `lazy`, `sleep`],
includes(`lazy`),
),
)
//=> true
console.log(
pipe(
[`sloth`, `lazy`, `sleep`],
includes(`awake`),
),
)
//=> false
Since
v0.0.2
Call Signature
includes(
searchElement
): <Value
>(iterable
) =>boolean
Parameters
searchElement
unknown
Returns
Function
Type Parameters
• Value
Parameters
iterable
Iterable
<Value
, any
, any
>
Returns
boolean
Defined in
Call Signature
includes<
Value
>(searchElement
,iterable
):boolean
Type Parameters
• Value
Parameters
searchElement
unknown
iterable
Iterable
<Value
, any
, any
>
Returns
boolean