Both choices are the same!


#1

This one is giving me some trouble. I keep looking at how others structured theirs, but it led me nowhere.

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!;
}
};
Like I said, I took advice from old posts, so I'm not sure how accurate they are.


#2

normally when you have a function, it has a opening and closing curly bracket:

var compare = function(choice1, choice2){
  // code inside the function
}

your function is missing its curly brackets. Also the semi-colon you have:

var compare = function(choice1, choice2); <- this one

is rather dangerous, it prevents the function from executing properly


#3

It's still not working.


#4

take a look at this line:

return "Paper wins!;

you forgot to close the string with a quotation mark (")


#5

Okay, it works now, thank you!:slight_smile: