Function take

  • Emits up to count number of values, then stops the iteration.

    import {pipe, take} from 'iter-ops';

    const i = pipe(
    [1, 2, 3, 4, 5],
    take(2)
    );

    console.log(...i); //=> 1, 2

    Type Parameters

    • T

    Parameters

    • count: number

    Returns Operation<T, T>