Skip to main content

$every

The $every operator checks if all elements in an array satisfy a provided condition.

Input

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

Output

  • true if all elements satisfy the condition, false otherwise

Examples

Check If All Numbers Are Even

Result: true

Check If All Objects Have Positive Age

Result: true