Computer choice Pt.2


#1



https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/4?curriculum_id=506324b3a7dffd00020bf661


It says "0.7138266071062784 ReferenceError: Scissors is not defined"
(or whatever option the number correlates to)
It also says "Oops, try again. Your code doesn't look quite right. Check the Hint if you need help!"
Thank you


var userChoice = prompt("Rock, Paper, or Scissors?")
var computerChoice = Math.random()
console.log(computerChoice)
if (0 <= computerChoice <= 0.33) {
    computerChoice=Rock;
} else if (0.34 <= computerChoice <= 0.66 ) {
    computerChoice=Paper;
} else {
    computerChoice=Scissors;
}
console.log(computerChoice)


#2

We need to be assigning a string value, "rock". What you have looks like an identifier to JS so will raise an exception..


#3

thank you, this helped x


#4

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