CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
forEachRight.js32 linesDownload Raw Back to lodash
1var arrayEachRight = require('./_arrayEachRight'),2    baseEachRight = require('./_baseEachRight'),3    castFunction = require('./_castFunction'),4    isArray = require('./isArray');5 6/**7 * This method is like `_.forEach` except that it iterates over elements of8 * `collection` from right to left.9 *10 * @static11 * @memberOf _12 * @since 2.0.013 * @alias eachRight14 * @category Collection15 * @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 _.forEach19 * @example20 *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 31module.exports = forEachRight;32 
basant307/AI_Governance_Project · CoolFace