4.17.11
3.10.1
2.4.2
1.3.1

_.forEachRight(collection, [iteratee=_.identity])

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

Since

2.0.0

Arguments

argument
collection
[iteratee=_.identity]
type
(Array|Object)
Function
description
The collection to iterate over.
The function invoked per iteration.

Returns

(array)

Example

_.forEachRight(
  [1, 2],
  function (value) {
    console.log(value);
  }
);
// => Logs `2` then `1`.
_.forEachRight([1, 2], function (value) {
  console.log(value);
});
// => Logs `2` then `1`.