There are six types of constants in haXe. We will now take a look at all of them. Some of them are composed of several kinds of them.
The first type of constants is one that is spread most across programming languages: Booleans. For your information, in haXe Booleans have the type
Bool
. The following are two expressions, which are Boolean constants:
true
false
That's both easy and important. By the way, in haXe Bool is indeed an Enum (if you don't know what this is, don't worry, we will learn about it later). This Enum has two values, and true and false are just reference to these values.
Booleans are generally used to represent the truthiness of things. For example, when one is presented with a checkbox in an interface, the "checked" property of the checkbox can be of type Bool.