Skip to content

Instantly share code, notes, and snippets.

@mohessaid
Created February 1, 2019 21:36
Show Gist options
  • Save mohessaid/2da3b7179d47738c964cc5050fe1753f to your computer and use it in GitHub Desktop.
Save mohessaid/2da3b7179d47738c964cc5050fe1753f to your computer and use it in GitHub Desktop.
The switch statement quirck
var a = 'a';
var b = 'b';
switch(a,b){
case 'a', 'b':
console.log('first case');
break;
case 'z', 'd':
console.log('second case');
break;
default:
console.log('default case');
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment