Sha256: 046ba7cf4c35433257caa41239d65be27a71a5927a79c69be557f5a2ff4f4a07
Contents?: true
Size: 630 Bytes
Versions: 153
Compression:
Stored size: 630 Bytes
Contents
/** * A specialized version of `_.filter` for arrays without support for callback * shorthands and `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
153 entries across 80 versions & 8 rubygems