7 What if choice 1 is paper


#1


Oops, try again. Your code returned 'paper 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")
    {
        if(choice2 === "scissors")
        {
            return "rock wins";
        }
        else
        {
            return "paper wins";
        }
    }
    else if(choice1 === "paper")
    {
        if(choice2 = "rock")
        {
            return "paper wins";
        }
        else
        {
            return "scissors wins";
        }
    }
};

I dont understand where my mistake is.


#2

here:

if(choice2 = "rock")

a single equal sign will assign, it will not check if the things are equal


#3

omg... so easy...

Thank u very much stetim94!


#4