Skip to main content
ZEN provides operators for arithmetic, comparison, logic, and data manipulation.

Arithmetic operators

Perform mathematical calculations on numbers.

Operator precedence

Operations follow standard mathematical precedence:
  1. ^ (power)
  2. *, /, % (multiply, divide, modulo)
  3. +, - (add, subtract)
Use parentheses to control order:

Comparison operators

Compare values and return boolean results.

Logical operators

Combine boolean conditions.

Short-circuit evaluation

Logical operators stop early when the result is determined:

Ternary operator

Conditionally return one of two values.
Examples:
Nested ternary:

Null coalescing operator

Return the first non-null value.
Examples:

Membership operators

Check if a value exists in a collection or range.

In operator

Not in operator

Negate membership tests:

String operators

Concatenation

The + operator joins strings:

Template strings

Embed expressions in strings:

Array operators

Index access

Object operators

Property access

Optional chaining

Access nested properties is optional:

Operator precedence table

From highest to lowest precedence: