This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by Hala Bahaa
over 8 years

HELPPPP 4/9 SyntaxError: Unexpected token {

WHAT’S WRONG WITH IT ????????????? var userChoice = prompt(“Do you choose rock, paper or scissors?”) var computerChoice = Math.random() console.log(computerChoice);

if (computerChoice < 0.33) { console.log(“rock”); } else if ( computerChoice < 0.66) { console.log(“paper”); } else ( computerChoice < 1) { console.log(“scissors”); };

Answer 55f59760e39efefc08000525

1 vote

Permalink

change all of your console.log(s): inside the if statement, you do not print rock, paper or scissors you change the value of computerChoice. (eg. computerChoice = rock)

var userChoice = prompt(“Do you choose rock, paper or scissors?”) var computerChoice = Math.random() console.log(computerChoice);

if (computerChoice <= 0.33) { computerChoice = “rock”; } else if ( computerChoice <= 0.66) { computerChoice = “paper”; } else { computerChoice = “scissors”; };

points
Submitted by minecraft9260
over 8 years

Answer 55f59490d3292f725b00060b

0 votes

Permalink

I have the same problem :(

points
Submitted by minecraft9260
over 8 years