What if choice 1 is rock HELP


#1



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

}
}


unexpected end of input


Replace this line with your code.


#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.