Switch Statement Output
@katepapineni
What is the output?
const a = "1";
switch (+a) {
case "1":
console.log("🍕");
break;
case 1:
console.log("🚀");
break;
default:
console.log("👻");
}
Option 1
🍕
Option 2
🚀
Option 3
👻
What is the output?
const a = "1";
switch (+a) {
case "1":
console.log("🍕");
break;
case 1:
console.log("🚀");
break;
default:
console.log("👻");
}
🍕
🚀
👻