![]() |
VOOZH | about |
Lodash _.some() method is used to check if the predicate returns true for any element of the collection. Iteration is stopped once the predicate returns true.
_.some(collection, [predicate])Return value: This method is used to return true if any element passes the predicate check, else false.
Example 1: In this example, It is returning true as it has passed the predicate check.
Output:
trueExample 2: In this example, It is returning false as it has not passed the predicate check.
Output:
falseExample 3: In this example, It is returning true as it has passed the predicate check.
Output:
trueExample 4: In this example, It is returning true as it has passed the predicate check.
Output:
true