Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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