Skip to main content

$and

The $and operator evaluates multiple expressions and returns true if all of them are truthy, otherwise it returns false.

Input

  • An array of expressions to evaluate
  • Each expression is evaluated in order from left to right

Output

  • true if all expressions evaluate to truthy values
  • false if any expression evaluates to a falsy value

Examples

Basic Example

Result: true

Multiple Expressions

Result: true if the age is greater than or equal to 18 and the status is “active”, otherwise false

With Falsy Value

Result: false