Use is it for if, or is it for else if, and abuden for else. Conditions must be wrapped in parentheses.
is it (umur >= 18) {
eh "Adult already lah";
}
is it (score >= 50) {
eh "Pass!";
} abuden {
eh "Fail lah";
}
is it (umur >= 18) {
eh "Adult";
} or is it (umur >= 13) {
eh "Teenager";
} abuden {
eh "Still small kid";
}
You can chain as many or is it blocks as you need:
dei grade = 85;
is it (grade >= 90) {
eh "A";
} or is it (grade >= 80) {
eh "B";
} or is it (grade >= 70) {
eh "C";
} or is it (grade >= 60) {
eh "D";
} abuden {
eh "F";
}
Each block ({ }) creates a new scope. Variables declared inside a block are not visible outside:
dei x = "outer";
is it (can) {
dei x = "inner";
eh x; // "inner"
}
eh x; // "outer"
- Loops — while, range, and foreach loops