Can someone please tell me what is wrong with my code (rock papers scissors)


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


i don't see anything wrong with the actual code but it might be a problem with the instructions. what does the error say?


Oops, try again. There was a problem with your syntax.


oh the first return has parenthesis and it doesn't need that, only console.log has ()


Thank you for that,but it still doesn't work.
Apparently there is still an issue with my syntax. SyntaxError: Unexpected end of script


can you send me a link?


you didn't close your function

and it is recommended that remove the ; after }


Thanks that fixed it!


Thanks for your help!! All fixed now


actually it looks like the 2nd if statement isn't closed.


no problem, anytime.