• Calls a Callback for each element of an Iterable.

    Example

    Print all elements

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

    See

    map and tap for similar operations

    Type Parameters

    • T

      the Iterable value type

    Parameters

    • callback: Callback<[T]>

      the Callback to call

    Returns ((iterable: Iterable<T>) => void)

Generated using TypeDoc