Code error not sure if the code is the problem or your exercise


#1


Code your own adventure 4. SWITCH

I think the code below should pass the exercise yet still I am seeing this error:

Oops, try again. Make sure to use a break statement with each case!


var user = prompt("Do you want to proceed? ").toUpperCase();

switch(user){
    case "YES":
        console.log("case 1");
    break;
    case "NO":
        console.log("case 2");
    break;
    case "MAYBE":
        console.log("case 3");
    break;
    default:
        console.log("error");

}


#2

HI Really don't know why but if you change all your strings inside the console.log() to other string instead of case it will work,


#3

Hahaha yeah really strange bro thank you for your help it solves this problem :slight_smile: