Skip to main content

Function: dropWhile()

Returns an iterable containing the values of iterable in iteration order starting with the first value for which fn returns a falsy value.

Example

console.log(
pipe(
[1, 2, 3, 4, 5, 6, 7, 8, `sloth`],
dropWhile(value => value < 5),
reduce(toArray()),
),
)
//=> [ 5, 6, 7, 8, 'sloth' ]

Since

v0.0.1

Call Signature

dropWhile<Value>(fn): (iterable) => Iterable<Value, any, any>

Type Parameters

Value

Parameters

fn

(value) => unknown

Returns

Function

Parameters

iterable

Iterable<Value, any, any>

Returns

Iterable<Value, any, any>

Defined in

splices.d.ts:28

Call Signature

dropWhile<Value>(fn, iterable): Iterable<Value, any, any>

Type Parameters

Value

Parameters

fn

(value) => unknown

iterable

Iterable<Value, any, any>

Returns

Iterable<Value, any, any>

Defined in

splices.d.ts:28