# How to come out of a switch case in JavaScript?

JavascriptWeb DevelopmentFront End Technology

To come out of a switch case, use the break statement. The break statements indicate the end of a particular case. If they were omitted, the interpreter would continue executing each statement in each of the following cases.

## Example

You can try to run the following example to implement switch-case statement, which uses break statement

Live Demo

<html>
<body>
<script>
document.write("Entering switch block<br>");

case 'A': document.write("Excellent<br />");
break;

case 'B': document.write("Very good<br />");
break;

case 'C': document.write("Passed<br />");
break;

case 'D': document.write("Not so good<br />");
break;

case 'F': document.write("Failed<br />");
break;

</html>