Skip to content

Instantly share code, notes, and snippets.

@rahulsivalenka
Created April 17, 2016 05:32
Show Gist options
  • Save rahulsivalenka/3007b78c76ac58aac3aeafae35a46005 to your computer and use it in GitHub Desktop.
Save rahulsivalenka/3007b78c76ac58aac3aeafae35a46005 to your computer and use it in GitHub Desktop.
Using conditions in switch stament
var cnt = 15;
switch(true) {
case cnt < 0:
console.log('We r at a loss!');
break;
case cnt > 0:
console.log('Somethin in it!');
break;
default:
console.log('Nothin in it!');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment