Menu
Riverview Church

ELSE IF

else if executes when an alternate condition is true.

Multiple else if statements are allowed.

The else statement is optional.

SYNTAX

if (condition1) {
    code
} else if (condition2) {
    code
} else if (condition3) {
    code
...
} else {
    code
}

EXAMPLES

TRUE

FALSE

INTERNAL

else

if

switch

try catch

EXTERNAL

Mozilla Developer Network