8. What if choice1 is "scissors"


#1

What am I doing wrong?

var compare = function(choice1, choice2)
{if (choice1 === choice2)
{return "The result is a tie!";}

else if (choice1 === "rock")
{if (choice2 === "sissors")
{return "rock wins"}
else {return "paper wins"}}

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

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


#2

Too many closing brackets in multiple places. A line that returns the wrong string and a line that shouldn't exist.

else if (choice1 === "paper")
{if  (choice2 === "rock") /// opens else if
{return "paper wins"} ///opens and closes if
else {return "scissors wins"}}} ///opens and closes else. Closes else if AND closes function

else if (choice1 === "scissors")
{if (choice2 === "rock") ///opens else if
{return "paper wins"} /// opens and closes if.  This line should say "rock wins" not paper wins
{if (choice2 === "paper") ///opens something but really this line shouldn't exist at all
else {return "scissors wins"}}}}; ///opens and closes else. Closes else if.
///closes function AND closes something random that shouldn't have existed in the first place.

Hope this all helps