Product SiteDocumentation Site

2.2.5. Control Statements (if, else, while, for, switch)

if (condition1) {
    statement1;
} else if (condition2) {
    statement2;
} else {
    statement3;
}
switch (expression) {
    case 0:
        command1;
        break;
    case 1:
        command2;
        break;
    default:
        command3;
}