.4 Switch My case always ends up as default?


#1

Can someone tell me why my answer is always default?

var user = prompt ("What super power would you want?").toUpperCase();

switch (user) {
case "Super strength":
console.log("Show me what you got");
break;
case "Speed":
console.log("Catch me if you can");
break;
case "Mind control":
console.log("No one can stop me");
break;
default:
console.log("I just want to be normal")
};


#2

var user = prompt ("What super power would you want?").toUpperCase();

the value users input will be UpperCase

but here
case "Super strength": //you need to change to UpperCase

same for the rest.

remember javascript is case-sensitive


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.