HEXOLANGGitHub ↗

Conditions & loops

if / else and for loops.

Conditions use if / else. The classic for loop takes an initializer, a condition and an update. while, for...in, break and continue are also available.

hexo
let age = 18;

if (age >= 18) {
    print("Adult");
} else {
    print("Minor");
}

for (let i = 0; i < 5; i++) {
    print(i);
}
Last updated 2026-11-21Suggest an edit ↗