In addition to if…else , JavaScript has a feature known as a switch statement . switch is a type of conditional statement that will evaluate an expression against multiple possible cases and execute one or more blocks of code based on matching cases.
Read moreCan we use char in switch case in C++?
switch statement can handle int and char in C++ . char data type can hold only one letter. Thus, if you input only one letter ( X ) for XL size will be fine …9 Eki 2013
Read moreCan switch case be used for char?
You can use char ‘s for the switch expression and cases as well .
Read more