* 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)
| 572 | * @returns {Array} Returns the new filtered array. |
| 573 | */ |
| 574 | function arrayFilter(array, predicate) { |
| 575 | var index = -1, |
| 576 | length = array == null ? 0 : array.length, |
| 577 | resIndex = 0, |
| 578 | result = []; |
| 579 | |
| 580 | while (++index < length) { |
| 581 | var value = array[index]; |
| 582 | if (predicate(value, index, array)) { |
| 583 | result[resIndex++] = value; |
| 584 | } |
| 585 | } |
| 586 | return result; |
| 587 | } |
| 588 | |
| 589 | /** |
| 590 | * A specialized version of `_.includes` for arrays without support for |
no test coverage detected