Sha256: 9e5aead3f122ed7b0751ec81875d9e3aa02d5b1c8334d9378cf70b48e2c31d26
Contents?: true
Size: 617 Bytes
Versions: 14
Compression:
Stored size: 617 Bytes
Contents
var baseEach = require('./baseEach'); /** * The base implementation of `_.filter` without support for callback * shorthands or `this` binding. * * @private * @param {Array|Object|string} collection The collection to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function baseFilter(collection, predicate) { var result = []; baseEach(collection, function(value, index, collection) { if (predicate(value, index, collection)) { result.push(value); } }); return result; } module.exports = baseFilter;
Version data entries
14 entries across 7 versions & 1 rubygems