What if choice1 is rock? I feel that my code has no errors?!


#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

@bandit,
You are missing 1 closing-curly-bracket-}
with which you close the compare function....


#3

Ohhhh was my last curly bracket just for closing the Else/if?