What if choice 1 is Rock error


#1


Link


I am getting the error message : "Unexpected end of input" What did I do wrong?


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

Missing a closing brace for the function body. It probably doesn't matter, but the instructions are (if I recall),

return "rock wins";

and nothing else. When you are done this module you are free to write whatever you wish, but for the best results, stick with the instructions.


#3

Thank you so much for your help.


#4

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