Logical Operators || and &&


I will paste my code here. The editor gives me an error msg about a problem with &&. Anyone see errors, punctionation, caps, anything?

`var user = prompt("How much do you want to win the lottery? A lot, A little, or Not Sure?").toUpperCase();

case "A LOT":
var luck = prompt("Luck is on your side! Do you want it?").toUpperCase();
console.log("Let's begin.");
} else {
console.log("OK. Let's wait 5 min.");

case "A LITTLE":
    var scared= prompt("Are you afraid to lose?");
    if (scared==="YES"){
    console.log("OK.  Maybe a friend can play.");
    }else {
        console.log("OK.  Let's start then.");
case "NOT SURE":
    var  excited = promt("Are you Serious or  Ready?").toUpperCase();
    var money= prompt("Are you poor or rich?").toUpperCase()
    if( (excited==="SERIOUS" || excited==="READY")) && (money==="RICH")
    { console.log("You're going to win!!!");
        console.log("You can't win that way.");




You're only using that operator in one place, so that tells you where to look!

You might want to create a simpler version of using && to compare with.


@mccbjnn Looks like you closed the parentheses too soon.

Instead of:

if ((excited === "SERIOUS" || excited === "READY")) && (money === "RICH")

it should be

if ((excited === "SERIOUS" || excited === "READY") && (money === "RICH"))

Make sense?


Yes....thanks will give it a try.


That did it, thanks.