JavaScript Switch Statement vs if/else if
It is not always clear when one should use an if/else if statement construct versus a switch statement. The general rule is that if the code requires a many chained series of if/else if statements, then it is more efficient to use a switch statement to…