MCPcopy
hub / github.com/lodash/lodash / baseFilter

Function baseFilter

lodash.js:2959–2967  ·  view source on GitHub ↗

* The base implementation of `_.filter` without support for iteratee shorthands. * * @private * @param {Array|Object} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered arra

(collection, predicate)

Source from the content-addressed store, hash-verified

2957 * @returns {Array} Returns the new filtered array.
2958 */
2959 function baseFilter(collection, predicate) {
2960 var result = [];
2961 baseEach(collection, function(value, index, collection) {
2962 if (predicate(value, index, collection)) {
2963 result.push(value);
2964 }
2965 });
2966 return result;
2967 }
2968
2969 /**
2970 * The base implementation of `_.flatten` with support for restricting flattening.

Callers

nothing calls this directly

Calls 1

predicateFunction · 0.50

Tested by

no test coverage detected