How to write switch statements multiple cases in JavaScript?

Posted by Rohit Kumar | Updated on

Want to write switch statements multiple cases in JavaScript? Use the fall-through feature of the switch statement. A matched case will run until a break (or the end of the switch statement) is found, so you could write it like:


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers