7. what if choice1 is paper?


I have spent a lot of time on this but still cant find the bug!
help a bro out

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";
} else if (choice1 === "paper") {
if (choice2 ==="rock")
return"paper wins";
} else {
return "scissors wins";


What's it doing differently from what you want? "bug" doesn't describe the issue!


if (choice2 === "scissors")

all you have to do is put a { at the end.

if (choice2 === "scissors") {

It should work.


Thanks a lot this was a big help unlike the smart*** about having a problem with my wordage.


Your wording? Your lack thereof you mean? If you want something, make it easy to give that to you. It's up to you to ask questions that let you move on. Dumping code and saying there's "a problem" will reduce the number of people willing to help. I explained what information I was missing, I didn't respond to be clever.


Np buddy he's right its easier if you give the problem it prompts you with like syntax, token else, that type of thing. But it was a small code so I didn't think it was that big of a deal to just find what was wrong.