Skip to main content

Variable: any

const any: Predicate

Defined in: predicates.d.ts:174

Returns true if fn returns a truthy value for any value of iterable. Otherwise returns false.

Like Array.prototype.some, but for iterables.

Example

import { any, pipe } from 'lfi'

console.log(
pipe(
[`sloth`, `lazy`, `sleep`],
any(word => word.includes(`s`)),
),
)
//=> true

console.log(
pipe(
[`sloth`, `lazy`, `sleep`],
any(word => word.includes(`x`)),
),
)
//=> false
Playground

Since

v0.0.1