0.0.1 • Published 8 years ago
@nathanfaucett/array-filter v0.0.1
array-filter
creates a new array with all elements that pass the test implemented by the provided function.
var arrayFilter = require("@nathanfaucett/array-filter");
var array = arrayFilter([1, 2, 3, 4, 5, 6], function isDivisibleBy2(value, index, array) {
return value % 2 === 0;
});
// array === [2, 4, 6]
0.0.1
8 years ago