Interesting at first glance, but what is the performance of this? It looks like all cases would have to be evaluated before picking one, so even slower than an if-else-if.
function test() {
switch (true) {
case console.log('asdf') === undefined: return 1;
case console.log('qwer') === undefined: return 2;
}
}
test();