Not working


#1


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

Unexpected token


 var userChoice = function(Choice) {
}
 userChioce = prompt ("Do you choose rock,paper or scissors?")
 var computerChoice = function(Choice)  
}
 computerChoice = Math.random(){
}
 
 if(computerChoice <= 0.33){
 }
 console.log ("rock")
 else if (computerChoice >= 0.34) {
 }
console.log ("paper")
else (computerChoice


#2

You are yet to complete this. Or at least you didn't copy & paste full code.


#3

var userChoice = function(Choice) {
}
userChioce = prompt ("Do you choose rock,paper or scissors?")
var computerChoice = function(Choice)
}
computerChoice = Math.random(){
}

if(computerChoice <= 0.33){
}
console.log ("rock")
else if (computerChoice <= 0.66) {
}
console.log ("paper")
else {
("scissors")
}


#4

Should be a prompt to get users input.

See full suggested code below:

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

#5

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