What if choice1 is paper? Help!


#1

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

Here it says the code has an "unexpected end of input". I have checked thoroughly and I cannot find what it is talking about?

Please help!

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"
        }
    }else if (choice1 === "paper"){
        if (choice2 === "rock"){
            return ("paper wins")
        } else{
            return ("scissors wins")
        }
    }

Thank you!


#2

never mind i figured it out


#3

Missing one more curly brace at the end.


#4

thankyou. After looking at it for 15 min, i decided to give up and put it up on the Q n A but the moment I looked back on it I figured it out. I felt dumb after that. Thx for the help!


#5

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