| layout | default |
|---|---|
| title | if-else-if |
| parent | Simple If |
| grand_parent | Control Statement |
| nav_order | 3 |
The if-else-if ladder statement executes one condition from multiple statements.
Syntax:
if(condition1){
//code to be executed if condition1 is true
}else if(condition2){
//code to be executed if condition2 is true
}
else if(condition3){
//code to be executed if condition3 is true
}
...
else{
//code to be executed if all the conditions are false
} 