Need help


#1

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

Can anyone tell me whats wrong with this?
computer says Oops, try again. Your code returned 'paper wins' instead of 'rock wins' when the inputs are rock and scissors
this is on number 6 rock paper scissors

...


#2

this line:

if (choice2 === "scissor")

you should spell scissors correctly, otherwise the else will run when the input is scissors, which explains the error message


#3

Thx it worked

Rohan