Function slice

Returns a section from an iterable.

'end' is the end index, not the number of items.

// Return five items from step 10
slice(it, 10, 15);

Iterable

Start step

Exclusive end step (or until completion)

  • Type Parameters

    • V

    Parameters

    • it: AsyncIterable<V>
    • Optionalstart: number
    • Optionalend: number

    Returns AsyncGenerator<V>

  • Type Parameters

    • V

    Parameters

    • it: Iterable<V> | V[]
    • Optionalstart: number
    • Optionalend: number

    Returns Generator<V>