What if choice 1 is rock HELP


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
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";

}
}

<In what way does your code behave incorrectly? Include ALL error messages.>
unexpected end of input

```

Replace this line with your code.

<do not remove the three backticks above>

#2

You need another ending curly brace.


#3

It totally worked. But, why I am new I do not understand the curly brace?? Can you explain?


#4

You needed it to close your function.

function hello() {
console.log("hello");
};

#5

as @cadecodes said, you need another curly brace. Without another curly brace, it’ll come up as a syntax error. Make sure before you submit that all your opening curly braces all have closing curly braces. Each one must have a beginning and an end.