1if (expression) {
2 Statement(s) to be executed if expression is true
3} else {
4 Statement(s) to be executed if expression is false
5}
6
1if (expression 1) {
2 Statement(s) to be executed if expression 1 is true
3} else if (expression 2) {
4 Statement(s) to be executed if expression 2 is true
5} else if (expression 3) {
6 Statement(s) to be executed if expression 3 is true
7} else {
8 Statement(s) to be executed if no expression is true
9}
10
1if (5 < 10) {
2 console.log("5 is less than 10");
3} else {
4 console.log("5 is now bigger than 10")
5}
1const randomObject = 5;
2if(randomObject < 2) {
3console.log("The Random Object has a value more than 2");
4}
5else {
6console.log("The Random Object has a value less than 2");
7}