7. What if choice1 is paper? Help very much needed!


#1

Hi, I'm totally stuck on this. Checked my code thousand times and still got no clue of what I did wrong. Any idea what's in here?

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

#2

else if(choice1 === "rock") {
    if(choice2 ==="scissors") 
        return "rock wins"
}
        else {
            return "papers wins";
        }
else if(choice1 === "paper") {

Watch your {}. The else if closes after the if then comes an else and then comes another else as part of the else if.


Syntax error in final step, coding rookie needs help
#3

Thanks Hanxor! That helped a lot!


#4


#5

What is this meant to be? A question a, a solution? Definitely need more information and if it is a question rather open your own thread.

¿Qué es este destinado a ser? Una pregunta una, una solución? Sin duda necesita más información y si se trata más bien abrir su propio hilo.