4/6 won't work properly! Help please!


#1

It works and all but if I type in Yes when the prompt comes up it will log the default not Me Too and I don't know why...?

var user = prompt("Do you like Star Wars?").toUpperCase();
switch(user) {
case 'Yes':
console.log("Me too");
break;
case 'No':
console.log("But its they are they best movies of all time");
break;
case 'I love it':
console.log("Oh My Goodness!! I do too!!");
break;
default:
console.log("I think you should watch them all!");
};


#2

var user = prompt("Do you like Star Wars?").toUpperCase(); //if u change .toLowerCase(); u need to change case like 'yes' 'no' 'i love it'
switch(user) {
case 'YES':
console.log("Me too");
break;
case 'NO':
console.log("But its they are they best movies of all time");
break;
case 'I lOVE IT':
console.log("Oh My Goodness!! I do too!!");
break;
default:
console.log("I think you should watch them all!");
};


#3

You are setting the variable user to upper case. Which means when yes is typed in no matter what the variable user = YES so when it checks the first case it will check if it is equal to 'Yes' which it is not.


#4

yes,exactly..:).....