source: imaps-frontend/node_modules/lodash-es/forEachRight.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 922 bytes
Line 
1import arrayEachRight from './_arrayEachRight.js';
2import baseEachRight from './_baseEachRight.js';
3import castFunction from './_castFunction.js';
4import isArray from './isArray.js';
5
6/**
7 * This method is like `_.forEach` except that it iterates over elements of
8 * `collection` from right to left.
9 *
10 * @static
11 * @memberOf _
12 * @since 2.0.0
13 * @alias eachRight
14 * @category Collection
15 * @param {Array|Object} collection The collection to iterate over.
16 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17 * @returns {Array|Object} Returns `collection`.
18 * @see _.forEach
19 * @example
20 *
21 * _.forEachRight([1, 2], function(value) {
22 * console.log(value);
23 * });
24 * // => Logs `2` then `1`.
25 */
26function forEachRight(collection, iteratee) {
27 var func = isArray(collection) ? arrayEachRight : baseEachRight;
28 return func(collection, castFunction(iteratee));
29}
30
31export default forEachRight;
Note: See TracBrowser for help on using the repository browser.