Lowdefy
v3.17.2/Operators/_and/

_and

(values: any[]): boolean

The _and operator performs a logical and over an array of inputs, using javascript truthy and falsy rules.

It only returns true if all the values in the array are truthy (not false, 0, null, undefined, or the empty string ""). Else it returns false.

Arguments

array

An array of values over which to perform a logical and.

Examples

Two true values:
_and:
  - true
  - true

Returns: true

Array of true and false values:
_and:
  - true
  - true
  - true
  - false

Returns: false

Check if two boolean inputs are true:
_and:
  - _state: confirm_accept_terms
  - _state: confirm_accept_privacy_policy

Returns: true if both inputs are true

Truthy values:
_and:
  - "Hello"
  - 42
  - []
  - key: value

Returns: true

Falsy values:
_and:
  - true
  - null

Returns: false

_and:
  - true
  - 0

Returns: false

_and:
  - true
  - ""

Returns: false