Control Statements
Conditional statements are used to perform different actions based on different conditions.
- Use if to specify a block of code to be executed, when condition is true.
- Use else to specify a block of code to be executed, when if condition is false.
- Use else if to specify a new condition to test, if the first condition is false.
var x = 10, y = 15;
if(x > y)
return x:
else
return y;