When creating variables, the keyword var is used. This identifies some name as a variable along with its type.
Haxe is a strongly-typed programming language. This means that all variables have a type. When creating variables, it must have a type to identify its contents.
The type of the variable follows its name with a colon. Every variable must have a type and colon. This statement ends in a semicolon.
There are three basic types in Haxe: Int, Float, and Bool.
An Integer in Haxe is any whole number.
A floating-point number is a decimal number.
A Bool is a Boolean value, either “true” or “false.”
Haxe supports many operators for working with two or more Int and Float values.
- Addition: (+)
- Subtraction: (-)
- Multiplication: (*)
- Division: (/)
- Modulo: (%)
Two unary operators are also supported:
- Increment: (++)
- Decrement: (–)