.remove()

Removes the entries that match the provided filter. Removes all the entries from the collection if no filter is provided.

remove(filter)

Parameter

Description

filter

Callbackarrow-up-right (optional)

Function to test each element of the array. Return a value that coerces to true to keep the element, or to false otherwise

Returns

Description

// Note: People is a collection.

People.get();  // [{ id: 1, name: 'Peter', salary: 1200 }, { id: 2, name: 'Michael', salary: 900 }] 

People.remove(person => person.salary < 1000); // [{ id: 1, name: 'Peter', salary: 1200 }] 

People.get();  // [{ id: 1, name: 'Peter', salary: 1200 }] 

Last updated