This forum is now read-only. Please use our new forums! Go to forums

0 points
Submitted by hipdweeb
over 8 years

[Resolved] Syntax error in my code?

This is what I have but I keep getting the dreaded syntax error message. What am I doing wrong?

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";
    }
}

};

Answer 55e77f06d3292f2987000333

0 votes

Permalink

Nvm, stared at it some more and figured it out! (Missing a left parenthesis before choice2).

points
Submitted by hipdweeb
over 8 years