Skip to main content

Variable: all

const all: Predicate

Defined in: predicates.d.ts:62

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

Like Array.prototype.every, but for iterables.

Example

import { all, pipe } from 'lfi'

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

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

Since

v0.0.1