Operators

Operators perform actions on values — doing math, comparing them, or combining logical conditions.

Arithmetic operators

Try it yourself
Console output

% is the remainder operator — 10 % 3 is 1, because 3 goes into 10 three times with 1 left over.

Comparison operators

=== checks if two values are equal and the same type. == only checks the value, ignoring type — which is why it's usually best to prefer ===.

Try it yourself
Console output

Logical operators

Try it yourself
Console output
Note: && means "and" (both must be true), || means "or" (at least one must be true), and ! flips a value — turning true into false.