Created
July 7, 2015 16:23
-
-
Save jpsullivan/87f9bb6b8ee092f97f2b to your computer and use it in GitHub Desktop.
JS - Switch with no breaks
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 user = "approach"; | |
switch(user) { | |
case 'approach': | |
console.log('1'); | |
case 'does': | |
console.log('2'); | |
case 'threes': | |
console.log('3'); | |
} |
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
Would output: | |
1 | |
2 | |
3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment