Please some help! Build "Rock, Paper, Scissors" Syntax error: Unexpected end of input


#1

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

<Below this line, in what way does your code behave incorrectly? Include ALL error mes

SyntaxError: Unexpected end of input

Replace this line with your code.

var compare = function(choice1,choice2) {
if (choice1 === choice2) {
return "The result is a tie!";
}
else if (choice1 === "paper") { if (choice2 === "rock") {return "paper wins"}
else { return "scissors wins"}
}

`


#2

your function:

var compare = function(choice1,choice2) {

the ( of your function doesn't have a matching }


#3

Sorry but I still don't get it, where exactly should I put the "}" or the "(" ?


#4

at the end? the conditions are nested inside the function


#5

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