• Takes the first count elements from the source.

    Type Parameters

    • T

      Type of items in the source.

    Parameters

    • count: number

      Number of elements to take.

    Returns OperationFunction<T, T>

    Operation that takes the first count elements from the source.

    const result = take<number>(2)([1, 2, 3, 4]);
    console.log([...result]); // [1, 2]