Lesson 5 syntax help!


Hello fellow coders. On lesson 5 ("Both choices are the same!"), I am having a syntax issue. My code is:

/*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);*/
var compare = function (choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie";

Error message: Oops, try again. Your compare function does not return 'The result is a tie!' when there is a tie.



here my code:
u forget to put the "!"
after the word "The result is a tie"

*return "The result is a tie!";


I already figured that out, but thanks anyway!



what are you doing here?
you are calling the function.right? function should be call after closing the function.


I found it on someone else''s code, tried it out, and it worked out fine. Now I'm just stuck on lesson 6.


it's good you sloved your problem :slight_smile:

simply you should create a new topic :slight_smile:


I already did, and solved it myself!


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