The collection to iterate over.
Optional
predicate: anyThe function invoked per iteration.
Optional
guard: anyEnables use as an iteratee for methods like map
.
Returns true
if any element passes the predicate check,
else false
.
some([null, 0, 'yes', false], Boolean);
// => true
var users = [
{ 'user': 'barney', 'active': true },
{ 'user': 'fred', 'active': false }
];
// The `matches` iteratee shorthand.
some(users, { 'user': 'barney', 'active': false });
// => false
// The `matchesProperty` iteratee shorthand.
some(users, ['active', false]);
// => true
// The `property` iteratee shorthand.
some(users, 'active');
// => true
Checks if
predicate
returns truthy for any element ofcollection
. Iteration is stopped oncepredicate
returns truthy. The predicate is invoked with three arguments: (value, index|key, collection).