Skip to content

Instantly share code, notes, and snippets.

@jpsullivan
Created July 7, 2015 16:24
Show Gist options
  • Save jpsullivan/24c6fbe528fa93a72ecf to your computer and use it in GitHub Desktop.
Save jpsullivan/24c6fbe528fa93a72ecf to your computer and use it in GitHub Desktop.
JS - Switch with breaks
var user = "approach";
switch(user) {
case 'approach':
console.log('1');
break;
case 'does':
console.log('2');
break;
case 'threes':
console.log('3');
break;
}
Would output:
1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment