Please help, what I did wrong?


#1

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

getting reply that my syntax is wrong :frowning: anyone can give me a hint ? please because obviously Im blind myself ...


#2

after else there should be a opening curly bracket:

if(choice1 === choice2) { 
        return "The result is a tie!";
        }
    else  <- no curly bracket

#3

Hi, I got it...
I missed curly bracket at the end :frowning:
Aaaaa Im going to loos my mental stability one day with this !!!
And thank you for the quick reply :wink:


#4

I hear you on that haha. Ordered a rockin chair for my own room at the local MHUnit...i'm not mad - per se, u c, i'd be crazy to think I'm mad