Code Your Own Adventure 2 - "Unexpected token default"


#1


Currently working on my code and it says that I have a syntax error that I cannot find. 
Please help!

var user = prompt("You accidentally sleep walk into another person's house. Do you stay, run, or walk upstais?").toUpperCase();
switch(user) {
    case "STAY":
        console.log("The owner of the house sees you downstairs! Do you fight, run, or talk?");
        break;
    case "RUN":
        console.log("You were never caught! But don't sleep walk into people's houses again!");
        break;
    case "WALK UPSTAIRS":
        console.log("You walk upstairs and are greeted by a very scary looking dog. Do you stand still, run, or fight?");
        break; 
    default: 
        while(user === default) {
            prompt("Please choose one of the three options.").toUpperCase();
        }
}


#2

Try without while loop in default section.


#3

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