Function forEach

  • Executes a callback for each element in the source.

    Type Parameters

    • T

      Type of items in the source.

    Parameters

    Returns CollectorFunction<T, void>

    Collector that executes a callback for each element in the source.

    forEach<number>((x) => console.log(x))([1, 2, 3]);
    // 1
    // 2
    // 3