5. Logical Operators


#1


https://www.codecademy.com/en/courses/javascript-beginner-en-ZA2rb/0/5?curriculum_id=506324b3a7dffd00020bf661#

Oops, try again. There was a problem with your syntax. SyntaxError: Unexpected token var

I know I'm close but it just doesn't seem to work. No matter what I put in, I get the same error codes. Can someone please look at this and see if you can see what I haven't seen yet. Thank you.


var user = prompt("Where do you think your going?").toUpperCase;
var user = prompt("Name?");

switch(user) {
    case 'Juno':
        console.log("Hey, what kind of name is that?");
        break;
    case 'Dionne':
        console.log("Weren't you supposed to be at the party?");
        break;
    case 'Adrian':
        console.log("Adrian McNeill! is that you?");
        break;
    default:
        console.log("You're not the one I've been looking for!");
}
switch(month) {
    case 'holiday'
    var party = prompt("What party to you want to go to?").toLowerCase()
    var stayHome = prompt("I guess you're not going.").toLowerCase()
    party = true;
    stayHome = false; 
    
    if(day&&1=yes) {
        console.log("Happy Birthday");
    }
    else {
        console.log("Merry Christmas"); 
    }
        break;
        case " ":
            console.log("Which party is it at this point?");
    }
        break
    default:
            console.log("Are you sure that's the right one?");    
}


#2

Missing : on case statement.

The above declares and defines the same variable twice, wiping out the first declaration.


#3

How do I fix this? I'm still trying to understand.


#4

should I take out the case and leave the 2 variables, party and stayHome?


#5

The unexpected var is a result of the missing colon...

case 'holiday':

#6

Not if you mean for it to be there.

1) Ask yourself what you mean for that general area to behave
2) Find out what that looks like
3) Compare to what's there


#7

I always leave something out and then I don't see where it should be. Thank you for that.


#8

Everyone does that all the time. We therefore have to be able to find them. Can you see how you would find this missing one here based on the information that you had?


#10