5. Logical Operators need help


#1


Code Your Own Adventure 2! 5. Logical Operators


SyntaxError: Unexpected identifier


Replace this line with your code. 
var user = prompt("Are you ready kids?").toUpperCase();
switch (user) {
    case 'YES':
        var really ready = prompt("Are you really ready? (YES OR NO?)").toUpperCase();
        var really really ready = prompt("Are you really really ready? (YES OR NO?)").toUpperCase();
        if(really ready === "YES" && really really ready === "YES") {
            console.log("Cool");
        } else {
            console.log("k");
        }
        break;
        case 'NO':
            var no = prompt("Are you sure you aren't ready").toUpperCase();
            var really no = prompt("You sure about that?").toUpperCase();
            if(no === "NO" || really no === "NO") {
                console.log("k"); 
            } else {
                console.log("k");
            }
            break;
            case 'WHO ARE YOU?':
            console.log("The real question is who are you?");
            break;
            default:
            console.log("Speak up I can't hear you");
};


#2

JavaScript (and most other programming languages) does not allow variable names with spaces.


#3

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