The opposite of filter this method returns the elements of collection that predicate does not return truthy for.
filter
collection
predicate
The collection to iterate over.
The function invoked per iteration.
Returns the new filtered array.
5.9.0
[[pull]], [[pullAll]], [[pullAllBy]], [[pullAllWith]], [[pullAt]], [[remove]], [[filter]]
const users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': false }]reject(users, ({ active }) => active)// => objects for ['fred'] Copy
const users = [ { 'user': 'barney', 'active': true }, { 'user': 'fred', 'active': false }]reject(users, ({ active }) => active)// => objects for ['fred']
The opposite of
filter
this method returns the elements ofcollection
thatpredicate
does not return truthy for.