Skip to main content

$some

The $some operator checks if at least one element in an array satisfies a provided condition.

Input

  • An array containing an array to check and a condition to evaluate for each element

Output

  • true if at least one element satisfies the condition, false otherwise

Examples

Check If Any Number Is Even

Result: true

Check If Any Object Has Age Over 30

Result: true