Operators

Arithmetic, comparison, and logical operators.

Arithmetic

OperatorDescriptionExample
+Addition5 + 3 = 8
-Subtraction5 - 3 = 2
*Multiplication5 * 3 = 15
/Division6 / 2 = 3
%Modulo5 % 3 = 2

Comparison

OperatorDescription
==Equal
!=Not equal
<Less than
>Greater than
<=Less or equal
>=Greater or equal

Order of Operations

var result = 2 + 3 * 4;     // 14 (not 20)
var grouped = (2 + 3) * 4;  // 20

String Concatenation

var msg = "Hello" + " " + "World";
print(msg);  // Hello World

// Auto-conversion
var info = "Value: " + 42;
print(info);  // Value: 42