Operators
Arithmetic, comparison, and logical operators.
Arithmetic
| Operator | Description | Example |
|---|---|---|
+ | Addition | 5 + 3 = 8 |
- | Subtraction | 5 - 3 = 2 |
* | Multiplication | 5 * 3 = 15 |
/ | Division | 6 / 2 = 3 |
% | Modulo | 5 % 3 = 2 |
Comparison
| Operator | Description |
|---|---|
== | 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