Rock, paper, scissors. Help me


#1

it says "wrong syntax 'else'"

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

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

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

}
compare(userChoice,computerChoice);

#2

else can't follow immediately after another else

if you're having trouble finding it, fixing the indentation to match the curly braces may help


#3

Thanks for the tip brother, it worked now.