.has()
Checks if there is any entry matching the provided filter.
has(filter)
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
Returns
Description
Whether or not there is any entry matching the provided filter
// Note: Users is a collection.
Users.get(); // [{ id: 1, name: '5antos' }]
Users.has(u => u.name === '5antos'); // true
Users.has(u => u.id === 2); // false
Last updated
Was this helpful?