Operators

An operator is a symbol that performs an operation on one or more values. The values it operates on are called operands, and the result is a new value.

  operand   operator   operand
     5          +          3
              result
                8

Types of Operators#

Arithmetic Operators#

Perform mathematical calculations — addition, subtraction, multiplication, division, modulo.

See Arithmetic Operators for a full explanation and examples.

Comparison Operators#

Compare two values and produce a true or false result. Used to build conditions in if/else statements and loops.

See Comparison Operators for a full explanation and examples.

Logical Operators#

Combine or invert conditions. Used to build compound conditions like “A and B” or “A or B”.

See Logical Operators for a full explanation and examples.

Resources#