What's wrong with my code? Please help :)


#1

Hi guys! Seriously stuck- can't seem to work out what's wrong with my code? I get the message saying that I didn not return the message?

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


#2

Thats cause you didnt call your function.

add

compare("rock","rock");

And you should return the message.


#3

try return ("The result is a tie")


#4

No return doesn't require () around it. The problem is a missing ! at the end of the sentence.


#5

var compare = function(userChoice,computerChoice) {

if (userChoice === computerChoice) {
return "The result is a tie!";
}