Syntax error: unexpected end of input


#1


https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/1/2?curriculum_id=506324b3a7dffd00020bf661#

(Build R.P.S ch. 6)


please help me locate errors: "syntax error: unexpected end of input"


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

Where's your prompt function? You're missing it.

var userChoice = prompt("Do you choose rock, paper or scissors?");

#3

soooooo... add another closing bracket to the end and that will do the trick. (close function body and else)

....
else {
return "paper wins";
}
}
};

hope this saves somebody some time


#4

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