Lesson 6 Help


#1


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

I am seeing a Syntax Error: Unexpected end of script. What am I doing 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

@zachskymyers
Make sure to close the curly brackets when you declared the function and put a semicolon to end your variable:

var compare = function (choice1, choice2) {
   // The if else if statement inside of here
};