MCPcopy
hub / github.com/lodash/lodash / arrayFilter

Function arrayFilter

lodash.js:589–602  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 3

baseFunctionsFunction · 0.85
lodash.jsFile · 0.85
unzipFunction · 0.85

Calls 1

predicateFunction · 0.50

Tested by

no test coverage detected