Logical operators


#1

I can pass this one, but seems like there is an error,
which is whatever answer I put into, it only goes to 'else if' output.

I tried (art === "yes" && taste === "yes" ) as well, but seems like it has an same issue.
Not sure how it works ;( Help!

var user = prompt("which coffee do you like?");

switch(user) {
    case 'latte':
        var art = prompt("do you like latte art as well?").toLowerCase;
        var taste = prompt("what about the taste of it?").toLowerCase;
        if ( art === "yes" && taste === "yes" ) {
        console.log("What a complete latte lover!");
        }
        else if( art === "yes" || taste === "yes" ) {
        console.log("Latte is one of the many options you have!");
        }
        else {
            console.log("So I think you know latte in a different way");
        }

    break;
    
    case 'flat white':
        console.log("Aussie, aren't you?");
    break;
    
    case 'you':
        console.log("Oh shut up");
    break;
    
    
    default:
        console.log("Answer me!");
    break;
}

#2

is the corrrect form of expression.

is not.

There may be other issues but I have to jet, so fix your conditionals and see what surfaces next.


#3

Thanks for your reply,

switch(user) {
case 'latte':
var art = prompt("do you like latte art as well?").toLowerCase;
var taste = prompt("what about the taste of it?").toLowerCase;
if ( art === "yes" && taste === "yes" ) {
console.log("What a complete latte lover!");
}
else if( art ==="yes" || taste === "yes" ) {
console.log("Latte is one of the many options you have!");
}
else {
console.log("So I think you know latte in a different way");
}

But it still brings up the same output : So I think you know latte in a different way :wink: