Created
September 7, 2016 19:21
-
-
Save wertlex/b97115e0f2fe0bc023297f6b2db8edd5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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