You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
528 B

4 years ago
  1. /**
  2. * A specialized version of `_.forEachRight` for arrays without support for
  3. * iteratee shorthands.
  4. *
  5. * @private
  6. * @param {Array} [array] The array to iterate over.
  7. * @param {Function} iteratee The function invoked per iteration.
  8. * @returns {Array} Returns `array`.
  9. */
  10. function arrayEachRight(array, iteratee) {
  11. var length = array == null ? 0 : array.length;
  12. while (length--) {
  13. if (iteratee(array[length], length, array) === false) {
  14. break;
  15. }
  16. }
  17. return array;
  18. }
  19. module.exports = arrayEachRight;