1If - Else Statements
2if (condition) {
3// what to do if condition is met
4} else {
5// what to do if condition is not met
6}
7
1if (condition1) {
2 // block of code to be executed if condition1 is true
3} else if (condition2) {
4 // block of code to be executed if the condition1 is false and condition2 is true
5} else {
6 // block of code to be executed if the condition1 is false and condition2 is false
7}
1if (condition 1 is true) {
2 // code is executed
3} else if (condition 2 is true) {
4 // code is executed
5} else {
6 // code is executed
7}