4. Build rock paper scissors - what if choice one is rock?


#1

It keeps saying "Unexpected token else???
What am I doing wrong??? Here is my code:

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

Your else follows after a function. else may only come after an if-statement.


#3

I am confused, what function???


#4

The only one in your code.

if {
} else {
}

vs

function() {
} else {
}

#6

Wait, my only function is in the first line!