Skip to main content

Variable: drop

const drop: Sub

Defined in: splices.d.ts:241

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​

import { drop, pipe, reduce, toArray } from 'lfi'

console.log(
pipe(
[`active`, `awake`, `sloth`, `lazy`, `sleep`],
drop(2),
reduce(toArray()),
),
)
//=> [ 'sloth', 'lazy', 'sleep' ]
Playground

Since​

v0.0.1