How can one game be so hard?


#1

 else { 
        return "scissors wins";
    }
}
    else if (choice1 === "scissors") {
        if (choice2 === "paper") {
            return === "scissors wins"
        }
    }
        else{ 
            return "rock wins"
        }
};
console.log (compare(userChoice,computerChoice))


#2

What is wrong with my code, Help?


#3

if and else statements should be inside of else if.but in your case else statement is outside of else if .

else if (choice1 === "scissors") {
        if (choice2 === "paper") {
            return === "scissors wins"
        }
    } //you closed else if here //remove it( } )

should be close here

 else{ 
            return "rock wins"
        }
       // here you have to close else if // add a } bracket

and this line

return === "scissors wins"

remove ===


#4

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