function test() { switch (true) { case console.log('asdf') === undefined: return 1; case console.log('qwer') === undefined: return 2; } } test();