var code = 2 var text = 'jiji' switch (true) { case 3 === code: console.log('jiji1') break case 2 === code && 'jiji' === text: console.log('jiji2') break default: console.log('jiji3') }