Step 5, Build Rock scissors paper, both choices are the same. error message


#1



I think I have followed the instruction on when choice1=choice2, but I keep getting an error message.
This is the instructions:
1) We carried over the code from the previous section, but it is a comment. Leave it there for now.
2) Below the comment, declare a function called compare.
3) It takes two parameters, choice1 and choice2.
4) Inside the function, write an if statement. If choice1 === choice2, then return "The result is a tie!"

THis is my script and what I added in line 13 to 18:
1 /*var userChoice = prompt("Do you choose rock, paper or scissors?");
2 var computerChoice = Math.random();
3 if (computerChoice < 0.34) {
4 computerChoice = "rock";
5 } else if(computerChoice <= 0.67) {
6 computerChoice = "paper";
7 } else {
8 computerChoice = "scissors";
9 } console.log("Computer: " + computerChoice);
10 console.log("User: " + userChoice);*/
11
12
13 var compare = function(choice1, choice2) {
14 if (choice1 === choice2) {
15 return "the result is a tie!";
16 }
17
18 };

I have been looking at it for more than an hour and still can't see what is wrong. Please help.


https://www.codecademy.com/en/courses/javascript-beginner-en-Bthev-mskY8/1/1?curriculum_id=506324b3a7dffd00020bf661


This is the error I am getting:
Oops, try again. Your compare function does not return "the result is a tie!" when there is a tie.

/*var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
	computerChoice = "rock";
} else if(computerChoice <= 0.67) {
	computerChoice = "paper";
} else {
	computerChoice = "scissors";
} console.log("Computer: " + computerChoice);
console.log("User: " + userChoice);*/

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


#2

@natsc,

They ask

"The result is a tie!"

you use

"the result is a tie!"


#3

Thank you so much, I didn't realize that I missed the capital T.

Its working now.

Thanks again, I thought I was going crazy.