7. What if choice1 is paper?


Hey guys having trouble on this one . I have looked at other posts but cant find the solution.

SyntaxError: Unexpected token else



And where is your code that you should type?


  1. Inside the compare() function under the existing code, write another else if statement where the condition is choice1 === "paper".
  2. Inside this else if statement, write an if / else statement. If choice2 === "rock", return "paper wins". Else, return "scissors wins".

userChoice=prompt("Do you choose rock paper or scissors"); computerChoice=Math.random(); if (computerChoice <= 0.33) { computerChoice = "rock"; } else if (computerChoice >= 0.67) { computerChoice = "scissors"; } else { computerChoice = "paper"; } console.log(computerChoice);

I dont can find here anything


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.