Compute Choicer Part 2 i


#1

I tried over and over again. I think the code below is the one that makes more sense to me. Getting this message: SyntaxError: Unexpected token ')'...Please help. Thank you so much!

var userChoice = prompt("Do you choose rock,paper or scissors?");

var computerChoice = Math.random();
console.log (computerChoice)

if ( computerChoice === 0 < 0.34) {
computerChoice === "rock";

} else if (computerChoice === 0.34 < 0.68 ) {
computerChoice === "paper";

} else {computerChoice === 0.67 <= 1)

computerChoice === "scissors";
}


#3

You don't need a condition for your else statement. Just

else {
    /* random code */
}

#4

The lesson explains the code like this:

if
else if
else

That's why I out the condition


#5

....put the condition


#6

if and else if requires conditions in brackets ().
But else is just else.

if (foo === "foo") {
    console.log("foo");
} else if (foo === "foo foo"){
    console.log("foo foo");
} else { /* notice that it does't need a condition statement */
    console.log("foo foo foo");
};

edit: I wasn't telling you to remove the whole else part of your function.