Implement filter , a function that iterates over elements of collection, returning an array of all elements the callback returns truthy for. The callback is invoked with three arguments: (value, index|key, collection).
Definition: filter(collection, callback)
Example Usage:
var users = [
{ 'user': 'barney', 'age': 36, 'active': true },
{ 'user': 'fred', 'age': 40, 'active': false }
];
filter(users, (o) => { return !o.active; });
// => [{active: false, age: 40, user: "fred"}]
Code here
Loading…
Solution
The solution is in the solution branch, which can be checked out in the