What if choice1 is paper? Help!



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!


never mind i figured it out


Missing one more curly brace at the end.


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!


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