What if choice1 is rock?


#1


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";    }
        }
     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?


#2

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

var compare = function () {

};

#3

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


#4

i figured it out. thanks


#6