Rock, papers scissors


#1


There is a problem with part 2. I even tried copy-pasting the code from the hint and it still wont pass it.

var compare = function(choice1, choice2) {
    if(choice1 === choice2) {
        console.log("The result is a tie");
    }
};

can someone please tell me whats wrong with my code


#2

This may be silly, but try adding a "!" to the end of the console.log() string.

If that doesn't work, click "Reset Code" and do the exercise again. Let me know what happens that time through?


#3

var compare = function(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie";
}
}; this is the right answer instead of console.log it should be return


#4

yup the ! worked!!

im stuck on the final part now.. can u tell me whats wrong with my code?

}else (choice 1 === "scissors") {
if (choice 2 === "rock") {
return "rock wins";
}
else {
return "scissors wins";
}
}

};
compare("paper", "scissors");


#5

You've got a space between choice and the digits. Try squishing them together.

E.g. choice1 not choice 1.


#6

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