_.forEachRight

_.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

Aliases

_.eachRight

Arguments

  1. collection (Array|Object): The collection to iterate over.
  2. [iteratee=_.identity] (Function): The function invoked per iteration.

Returns

(*): Returns collection.

Example

_.forEachRight([1, 2], function(value) {
  console.log(value);
});
// => Logs `2` then `1`.
doc_Lodash
2016-11-27 16:36:36
Comments
Leave a Comment

Please login to continue.