Placeholder: ExerciseNumber ErrorMessage


#1

@han1070 please can you share your screen result as i have been stuck for a while:
see below screen :

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!";
}
};

How can i assign userChoice to choice1, and assign computerChoice to choice2
#2

You'd revived a month old topic with a new question, please don't do this but rather open your own (already did that for you, just need to change the title to something useful).

About the problem it seems like your compare function closes here:

var compare = function(choice1,choice2) {

if (choice1 === choice2) {

return "The result is a tie!";
}
}; // here

So the stuff that comes later is at a place where it is not allowed to be (undefined variables, not allowed return statements, missing connection between if and else if, you probably got one of those errors, right?). So better put this part back in the function to make it work.