7. What if choice1 is paper?


#1

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

SyntaxError: Unexpected token else


https://gist.github.com/55060191a076c414c2ef09c76dce04ec


#2

And where is your code that you should type?

Instructions

  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


#3

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