Sha256: 1b3fc8f1a3b07a6b8253e51d4b8308cb975dc69c86d2b627b45993f6037bb1ba
Contents?: true
Size: 629 Bytes
Versions: 14
Compression:
Stored size: 629 Bytes
Contents
/** * A specialized version of `_.filter` for arrays without support for callback * shorthands or `this` binding. * * @private * @param {Array} array The array to iterate over. * @param {Function} predicate The function invoked per iteration. * @returns {Array} Returns the new filtered array. */ function arrayFilter(array, predicate) { var index = -1, length = array.length, resIndex = -1, result = []; while (++index < length) { var value = array[index]; if (predicate(value, index, array)) { result[++resIndex] = value; } } return result; } module.exports = arrayFilter;
Version data entries
14 entries across 7 versions & 1 rubygems