JavaScript 007 – Switch-Case Structure

In if…else statement, we can do the comparison and decide the code flow direction. Sometime, a comparison may end-up in checking a variable with multiple possible values. Here, one can use a switch-case to avoid multiple if-else statements. Below is the structure of the JavaScript switch-case: