Exercise 6/9 is confused


#1

There is a bug here.


Link for the exercise

here's my code:

var compare = function(choice1, choice2) {
    if (choice1 === choice2) {
        return "The result is a tie!";
    }
    else if (choice1 === "rock") {
        if (choice2 === "scissers") {
            return "rock wins";
        }
        else {
            return "paper wins";
        }
    }
}
console.log(compare("rock", "scissers"));

when I save & submit code the error pops up:

Oops, try again. Your code returned 'paper wins' instead of 'rock wins' when the inputs are rock and scissors

but the console shows :

rock wins

because of the last line on my code, that prints on the console what the compare function returns.

Please help me :confused:

Ron Dankner


#2

you misspelled scissors


#3

You are right, and that what solved my problem.. thank you!
but let's ignore my misspell.. it's not what the console have returned..
i hate those bugs


#4