Last change
on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
528 bytes
|
Rev | Line | |
---|
[6a3a178] | 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 |
|
---|
| 13 | while (length--) {
|
---|
| 14 | if (iteratee(array[length], length, array) === false) {
|
---|
| 15 | break;
|
---|
| 16 | }
|
---|
| 17 | }
|
---|
| 18 | return array;
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | module.exports = arrayEachRight;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.