@newdash/newdash
Version:
javascript/typescript utility library
21 lines (20 loc) • 581 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* A specialized version of `forEachRight` for arrays.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns `array`.
*/
function arrayEachRight(array, iteratee) {
let length = array == null ? 0 : array.length;
while (length--) {
if (iteratee(array[length], length, array) === false) {
break;
}
}
return array;
}
exports.default = arrayEachRight;