Choice1 is rock


#1

i'm going thru the same issue code below, can someone spot what my syntax error is ?

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

};


What if choice 1 is rock: I can't seem to find the syntax error: end of input
What if choice 1 is rock: I can't seem to find the syntax error: end of input
#2

look at this line:

return "paper wins"";

is your string properly closed?


#3

thanks for the quick response
I was coming back to post that i found my syntax error by using the JS console on my browser.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.