+ 1
Please explain the output.
5 Answers
+ 3
If you don't use break then all case will be execute till the next break after the matched case
+ 2
You have to read again how switch works and in addition think, what happend when as in your example, will donât use a statement break.
+ 2
Kumar Anshuman
But case = 10 matched and there is no break in all next cases so all cases will be execute.
https://code.sololearn.com/cXYNRaL1de4A/?ref=app
+ 1
A͢J
case = 30 does not match then how does it execute?
+ 1
JaScript
Oh yes!
I got it.
As case = 10 is found to be correct , it will execute all the following statements even if the rest of the cases are correct or incorrect.