Use if to specify a block of code to be executed if a specified condition is true.
Use else to specify a block of code to be executed if the same condition is false.
Use else if to specify a new condition to test if the first condition is false
else and else if are optional. You can have as many else if clauses as you need.
if ( condition1 ) {
// insert block of code to be executed if condition1 is true
} else if ( condition2 ) {
// insert block of code to be executed if the condition1 is false and condition2 is true
} else {
// insert block of code to be executed if the condition1 is false and condition2 is false
}