Function forEachRight

  • This method is like forEach except that it iterates over elements of collection from right to left.

    Type Parameters

    • T

    Parameters

    • Optional collection: ArrayLike<T>

      The collection to iterate over.

      Optional
    • Optional iteratee: ArrayIteratee<T, void>

      The function invoked per iteration.

      Optional

    Returns void

    Returns collection.

    Since

    5.13.0

    Alias

    eachRight

    See

    [[forEach]], [[forIn]], [[forInRight]], [[forOwn]], [[forOwnRight]]

    Example

    forEachRight([1, 2], value => console.log(value))
    // => Logs `2` then `1`.
  • Type Parameters

    • T

    Parameters

    • Optional collection: PlainObject<T>
      Optional
    • Optional iteratee: RecordIteratee<T, void>
      Optional

    Returns void