7. What if choice one is paper? Oops, try again


#1


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

Been stuck on this for a while, cant for the life of me figure out whats wrong. Whenever i click submit code I get an error box that says "Oops, try again. Your code returned 'Rock wins' instead of 'scissors wins' when the inputs are paper and scissors"


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

};


#2

even if you input paper as choice1, it doesn't matter, this condition will evaluate to true:

else if (choice1==="rock","Rock")

i suspected this is because of your ,Rock. Are you sure you can use it this way? I never seen the notation. Same obviously for your choice1==="paper","Paper"


#3

try:
else if (choice1 === "rock" || choice1 === "Rock")

same for paper option