Created
April 17, 2016 05:32
-
-
Save rahulsivalenka/3007b78c76ac58aac3aeafae35a46005 to your computer and use it in GitHub Desktop.
Using conditions in switch stament
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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