Can somebody take a look at my code? My Rock isn't jiving with my paper and I want to use scissors


#1

I keep looking at this and I must be missing the obvious. I keep getting an error saying my outcome is wrong. here is the message I receive:
Oops, try again. Your code returned 'rock wins' instead of 'scissors wins' when the inputs are paper and scissors

Here is my code:

var compare = function (choice1, choice2) {

if (choice1 === choice2)
{
    return "The result is a tie!";
}
else if (choice1 === "rock", choice2 === "scissors") { 
    return "rock wins";
}
else if (choice1 === "rock", choice2 === "paper") {
        return "paper wins";
}
else if (choice1 === "paper", choice2 === "rock") {
       return "paper wins";

}
else if (choice1 === "paper", choice2 === "scissors") {
return "scissors wins";
}
};


#2

Please read
= http://www.codecademy.com/forum_questions/559dcb4be39efe550f00006b
and concentrate on

  • the creation of the compare-function
  • the build of the IF ELSE-IF statement structure