What if choice 1 is rock ? Lesson 6


#1

Can't find what is wrong here..... Just can't... Please help !

 if(choice1 === choice2) {
        return ("The result is a tie!");
}
    
else if(choice1 === "rock") {
    
    if(choice2 === "scissors") {
        return "rock wins";
    }
    else {
        return "paper wins";
    }
};

#2

Says : "There was a problem with your syntax."


#3

You are forgetting to close your else if statement after you return "rock wins"


#4

The () around the return value is not necessary and you seem to lack the var compare = function... line or at least didn't copy it. Last but not least you miss a closing } for the fucntion after the else if case.

@eren_s What do you mean by after return rock? Don't having one there should be fine.
There is a hint in 6/9 which shows an example for the else if case.


#5

Oh my bad, it's just that I did it that way and it worked.