Logical operators


#1


I get a SyntaxError: Unexpected token else
Please help!


var user = prompt("What is your name?");

switch(user) {
    case 'Don':
        var nice = prompt("Sick name wish I had a name like that! Do you want to know my name?");
        if (nice === "Yes" || "yes") {
            console.log("It's Java Script! But you can call me Java!");
        else {
            console.log("Thats a shame!");
        }
        break;
    case 'Prebish':
        var chosen = prompt("You're...You're the CHOSEN ONE!! What is the secret password CHOSEN ONE?");
        if (chosen === "Fart" && "Face") {
            console.log("You are the CHOSEN ONE!!");
        }
        else {
            console.log("Oh...It was a mistake");
        }
        break;
    default:
        console.log("Wow, how unorginal! Boring NEXT!");
}


#2

if (nice === "Yes" || "yes") {
            console.log("It's Java Script! But you can call me Java!");

you didnt close this if statement. missed a }


#3

This link will help with the operator issue:


#4

You're the real MVP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!


#5

please check the link what @biff75 posted to you because you really need that :slight_smile:


#6

Bruh forget about @rcodeman you DA Actual Real MVP @biff75


#7

Lol, we're all da real mvp :smile:


#8

yeah right!!!!!!!!! @biff75 :smiley: :smiley:


#9

Yeah we all know it's actually me :stuck_out_tongue:


#10

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