if
...else
Statement
If we want to do something else if the condition is false, we can use the else statement with if statement to execute a block of code when the condition is false. |
|
|
|
if else
(Ternary Operator)
if
, and one for else
, you can put it all on the same line:
|
|