Rock paper scissors error


#1

Here's the error that I'm getting:
Oops, try again. Your code returned 'The result is a tie!' instead of 'paper wins' when the inputs are rock and paper
And here's the code:

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);
var compare = function (choice1,choice2) {
if (choice1=choice2) {
return "The result is a tie!"
}
else if (choice1 === "rock") {
if (choice2 === "scissors") {
return "rock wins"
}
else {
return "paper wins"
}
}
}


#2
if (choice1=choice2) {

= makes choice1 become choice2 what you wan to do here is to compare them: Hint == or ===


#3

Ohhhhh Thanks! I'mma try to fix it XD


#4

Yep it totaly works now. Have a nice day :smile: