Constants and its types

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:

  1. true
  2. 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, ...

Get haXe 2 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.