MCPcopy Create free account
hub / github.com/lodash/lodash / arrayFilter

Function arrayFilter

lodash.js:574–587  ·  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

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

Callers 3

baseFunctionsFunction · 0.70
lodash.jsFile · 0.70
unzipFunction · 0.70

Calls 1

predicateFunction · 0.50

Tested by

no test coverage detected