'Is there a way to exit a case in a switch on a conditional?

I have code which deals with an event listener, and I need the code to pause and wait for the event before continuing execution. However, this code is run inside of a switch() statement. Is there a way to do something like this to exit the case? case(number): if(value){break;} This is being done in code.org by the way.



Solution 1:[1]

A break will allow you continue processing in the function. Just returning out of the switch is fine if that's all you want to do in the function.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ajay Gupta