Estrutura da declaração IF em JavaScript
if (condition) {
// statement
} else if(condition){
// statement
}else{
// statement
}
CodePadding
if (condition) {
// statement
} else if(condition){
// statement
}else{
// statement
}
if (condition1) {
// code to be executed if condition1 is true
} else if (condition2) {
// code to be executed if the condition1 is false and condition2 is true
} else {
// code to be executed if the condition1 is false and condition2 is false
}