* A specialized version of `_.filter` for arrays without support for * iteratee shorthands. * * @private * @param {Array} [array] The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array.
(array, predicate)
| 587 | * @returns {Array} Returns the new filtered array. |
| 588 | */ |
| 589 | function arrayFilter(array, predicate) { |
| 590 | var index = -1, |
| 591 | length = array == null ? 0 : array.length, |
| 592 | resIndex = 0, |
| 593 | result = []; |
| 594 | |
| 595 | while (++index < length) { |
| 596 | var value = array[index]; |
| 597 | if (predicate(value, index, array)) { |
| 598 | result[resIndex++] = value; |
| 599 | } |
| 600 | } |
| 601 | return result; |
| 602 | } |
| 603 | |
| 604 | /** |
| 605 | * A specialized version of `_.includes` for arrays without support for |
no test coverage detected