If…else is a conditional statement that will execute block of code when the passed condition is truthy. When the condition is false, it will execute the else block . In if statement truthy and falsy values get converted in true and false.
- if to specify a block of code to be executed, if a specified condition is evaluated to true.
- else to specify a block of code to be executed if the same condition is evaluated to false
- else if to specify a new condition to test, if the first condition is evaluated to false
- switch to specify many different blocks of code to be executed