SIGN IN SIGN UP

A modern JavaScript utility library delivering modularity, performance, & extras.

0 0 9 JavaScript
2015-01-08 00:37:01 -08:00
define([], function() {
/**
* A specialized version of `_.forEachRight` for arrays without support for
2015-12-16 17:53:20 -08:00
* iteratee shorthands.
2015-01-08 00:37:01 -08:00
*
* @private
2016-05-21 00:48:34 -07:00
* @param {Array} [array] The array to iterate over.
2015-01-08 00:37:01 -08:00
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEachRight(array, iteratee) {
2016-10-30 20:06:57 -07:00
var length = array == null ? 0 : array.length;
2015-01-08 00:37:01 -08:00
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
}
return arrayEachRight;
});