5/6 Where Did I Go Wrong?


#1

Where did I go wrong?

var user = prompt("Do you like jetfighter's attacking the world?").
switch (user) {
    case 'y':
        console.log("Yay!");
        break;
    case 'n':
        console.log("Nay!");
        break;
    case 'm':
        console.log("That is not an answer.");
        break;
    default:
        console.log("I don't know what you are talking about.");
};

Please explain where.
Error messages:
1.Oops, try again. There was a problem with your syntax.
2.SyntaxError: Unexpected token {


#2

you should write ; after
var user = prompt("Do you like jetfighter's attacking the world?"). // remove . add ;


#3

Thank you!!! :slight_smile: That helped a lot.


#4

var user=prompt("Who are you?").toLowerCase();

switch(user){
case '1':
console.log("Kyaw Kyaw");
var answer=prompt("Yes or No?");
if(answer==Yes && answer==No){
console.log("Yes he is Kyaw Kyaw");
}else{
console.log("No, hen't not");
}
break;
case '2':
console.log("Tun Tun");
break;
case '3':
console.log("Aye Aye");
break;
default:
console.log("No One.");
}
Someone please help me. Where is the error?