Please, Help! Everything is correct imho


Oops, try again. Did you set var computerChoice = Math.random() ? The capital 'M' in 'Math' is important!

var userChoice = prompt("Your choice?");
var computerChoice = Math.random();
if(computerChoice <= 0.33){
    computerChoice = "scissors";
else if(computerChoice>0.33 && computerChoice<=0.66){
    computerChoice = "paper";
else if(computerChoice>0.66){
    computerChoice = "rock";
console.log("Computer:" + computerChoice);
var compare = function (choice1, choice2){
        return "Tie!";}
    else if(choice1 === "rock"){
        if(choice2 ==="scissors"){
            return "rock win!";}
            return "paper win!";}}
    else if(choice1 === "paper"){
        if(choice2 === "rock"){
            return "paper win!";}
            return "scissors win!";}
    else if(choice1 === "scissors"){
            return "scissors win!";}
            return "rock win!";


Your compare function is missing a curly bracket in the end, I guess.


i added on curly bracket, shows "unexpected token }"


i think mistake is not about brackets)


Nope, I wrote wrong thing :slight_smile:


Why you use "choice1, choice2" if you haven't declare it yet?


Check what value it has by the time your code has finished.
What do instructions/error message say it should refer to?
What value does it refer to?


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