JavaScript Switch Case
from JavaScript 1.2 onwards, we can use a switch statement which provide alternative to if statements, and it does better than repeated if…else if statements. Syntax: The expression is evaluated and compared to each case label. If a match is found, the corresponding statement is executed. If no match is found, the defaultStatement (if provided) is executed. The break statement …