Skip to main content

Function: drop()

Returns an iterable containing the values of iterable in iteration order except for the first count values.

If the count is greater than the number of values in iterable, then an empty iterable is returned.

Throws

if count isn't a non-negative integer.

Example

console.log(
pipe(
[1, 2, 3, 4, 5, `sloth`],
drop(3),
reduce(toArray()),
),
)
//=> [ 4, 5, 'sloth' ]

Since

v0.0.1

Call Signature

drop<Count>(count): <Value>(iterable) => Iterable<Value, any, any>

Type Parameters

Count extends number

Parameters

count

NonNegativeInteger<Count>

Returns

Function

Type Parameters

Value

Parameters

iterable

Iterable<Value, any, any>

Returns

Iterable<Value, any, any>

Defined in

splices.d.ts:197

Call Signature

drop<Count, Value>(count, iterable): Iterable<Value, any, any>

Type Parameters

Count extends number

Value

Parameters

count

NonNegativeInteger<Count>

iterable

Iterable<Value, any, any>

Returns

Iterable<Value, any, any>

Defined in

splices.d.ts:197