What if choice1 is rock?


var compare=function(choice1,choice2)   {
if(choice1===choice2)   {
    return "The result is a tie"; 
    else if(choice1==="rock") 
    {   if(choice2==="scissors") 
    {   return "rock wins"; }
        {   return "paper wins";    }
     mozilla firefox says SyntaxError: missing } after function body
google chrome says SyntaxError: Unexpected end of input
could someone please tell me what's wrong with this?


Both of these point to the same error. A missing curly brace to close the function body.

var compare = function () {



I know what it means, but I have one so I don't understand what the problem is.


i figured it out. thanks