• Iterates over elements of collection invoking iteratee for each element. The iteratee is invoked with three arguments: (value, index|key, collection). Iteratee functions may exit iteration early by explicitly returning false.

    Note: As with other "Collections" methods, objects with a "length" property are iterated like arrays. To avoid this behavior _.forIn or _.forOwn may be used for object iteration.

    Type Parameters

    • T

    Parameters

    • collection: T[]

      The collection to iterate over.

    • Optional iteratee: ArrayIterator<T, any>

      The function invoked per iteration.

    Returns T[]

    Alias

    _.each

  • Parameters

    • collection: string
    • Optional iteratee: StringIterator<any>

    Returns string

    See

    _.forEach

  • Type Parameters

    • T

    Parameters

    • collection: List<T>
    • Optional iteratee: ListIterator<T, any>

    Returns List<T>

    See

    _.forEach

  • Type Parameters

    • T extends object

    Parameters

    • collection: T
    • Optional iteratee: ObjectIterator<T, any>

    Returns T

    See

    _.forEach

  • Type Parameters

    • T

    • TArray extends undefined | null | T[]

    Parameters

    • collection: {}
      • Optional iteratee: ArrayIterator<T, any>

      Returns TArray

      See

      _.forEach

    • Type Parameters

      • TString extends undefined | null | string

      Parameters

      • collection: TString
      • Optional iteratee: StringIterator<any>

      Returns TString

      See

      _.forEach

    • Type Parameters

      • T

      • TList extends undefined | null | List<T>

      Parameters

      • collection: {}
        • Optional iteratee: ListIterator<T, any>

        Returns TList

        See

        _.forEach

      • Type Parameters

        • T extends object

        Parameters

        • collection: undefined | null | T
        • Optional iteratee: ObjectIterator<T, any>

        Returns undefined | null | T

        See

        _.forEach

      Generated using TypeDoc