Returns the first entry that matches the provided filter.
Last updated 1 year ago
Parameter
Description
filter
Function to test each element of the array. Return a value that coerces to true to keep the element, or to false otherwise
true
false
Returns
First entry that matches the filter
// Note: Users is a collection. Users.create({ id: 1, name: '5antos' }); // { id: 1, name: '5antos' } Users.get(u => u.id === 1); // { id: 1, name: '5antos' } Users.get(u => u.name === 'Unnamed user'); // null