Consider following code snippet:

var ch1 = 'b';
var ch2;
switch(ch1) {
  case 'a':
     ch2 = '1';
  case 'b':
     ch2 = '2';
  case 'c':
     ch2 = '3';
     break;
  default:
     ch2 = '4';
}
What will be the value of ch2 variable?
Explanation
There is no break keyword in the case that match the conditions.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
JavaScript quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes