Skip to content

Instantly share code, notes, and snippets.

@wertlex
Created September 7, 2016 19:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wertlex/b97115e0f2fe0bc023297f6b2db8edd5 to your computer and use it in GitHub Desktop.
Save wertlex/b97115e0f2fe0bc023297f6b2db8edd5 to your computer and use it in GitHub Desktop.
function test(arg){
switch (true) {
case arg === 'test': {
const value = 'a';
return 'it was test';
}
case art === 'foo': {
const value = 'b';
return 'it was foo';
}
default:
return 'no match';
}
}
console.log(test('test'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment