diff options
Diffstat (limited to 'deps/npm/node_modules/lodash/internal/arrayEachRight.js')
-rw-r--r-- | deps/npm/node_modules/lodash/internal/arrayEachRight.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/deps/npm/node_modules/lodash/internal/arrayEachRight.js b/deps/npm/node_modules/lodash/internal/arrayEachRight.js new file mode 100644 index 0000000000..367e066d80 --- /dev/null +++ b/deps/npm/node_modules/lodash/internal/arrayEachRight.js @@ -0,0 +1,21 @@ +/** + * A specialized version of `_.forEachRight` for arrays without support for + * callback shorthands and `this` binding. + * + * @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) { + var length = array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; +} + +module.exports = arrayEachRight; |