Control Flow in Javascript
If-Else Statement The if-else statement evaluates a condition and executes a block of code if the condition is true. If the condition is false, it optionally executes an alternate block of code specified by else. In this example: Switch Statement…