What is wrong with my code?


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

}


#2

Does your code say "unexpected end of input"? Then I suggest putting two brackets at the end. :smiley:

If it says "unexpected token '}'", then take away a bracket at the bottom. Good? :smiley: