What is wrong with this code


#1

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice)

Oops, try again. Did you set var computerChoice = Math.random() ? The capital 'M' in 'Math' is important
Anyone can help me! What is wrong.Sorry for my English.


#2

HI try to refresh the page..


#3

every time JS send me this message
Oops, try again. Did you set var computerChoice = Math.random() ? The capital 'M' in 'Math' is important


#4

copy/cut the code then refresh the page and paste the code


#5

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