I am trying to make a rock paper scissors game for code academy and I was told to create a function for compare(). I have written the following code:
function compare(choice1,choice2){
if (choice1 == choice2){
console.log("The result is a tie!");
} else{
console.log("the computer wins");
}
when I run it, "The result is a tie!" appears twice but I get an error code saying "Oops, try again! Your compare function does not return 'The result is a tie!' when there is a tie." I know there is something wrong with my syntax but I am very new so I don't know where. Any help?