7/9 Error


#1

var compare = function(choice1,choice2)
{
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 === "rock"){
return "paper wins."}}
else{
    return "scissors wins."}
};

What have I done wrong?

P.S.: I've tried to integrate the following into a


#2

you know if erase all of your code and click the submit button you can go on to the next one along with the next 3 or 2 of the section


#3

@systempro13277 If you find bugs we'd appreciate if you report them within the lesson instead of encouraging students to exploit them. In the end this is made for learning so the one you're cheating on is yourself...

@martinvandenosine
Why do you start the compare function twice? Once should be enough.
Also you seem to miss a closing } here for the function:

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