1 var baseEach = require('./baseEach');
4 * The base implementation of `_.filter` without support for callback
5 * shorthands and `this` binding.
8 * @param {Array|Object|string} collection The collection to iterate over.
9 * @param {Function} predicate The function invoked per iteration.
10 * @returns {Array} Returns the new filtered array.
12 function baseFilter(collection, predicate) {
14 baseEach(collection, function(value, index, collection) {
15 if (predicate(value, index, collection)) {
22 module.exports = baseFilter;