I don't understand #7


#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"; }}};
if (choice1 === "paper"){
else if(choice2 === "rock"){
return "paper wins"
}

else {
return "scissors wins"
}
};
keeps saying SyntaxError: Unexpected token else


#2

The third line above is the unexpected else. There are bracket issues, for sure.

Block out the structure and fill in the bits when the structure looks right. Start with this,

var compare = function (choice1, choice2) {
    // body code
};

Now block the body code...

    if () {

    }
    else if () {
        if () {

        } else {

        }
    }
    else if () {
        if () {

        } else {

        }
    }

Now insert this into the function as noted and fill in the bits. Be sure to give every closing brace its own line so you can track the nesting levels better.