My syntax is off for compare function


#1

I'm wondering where is my issue with the syntax. The error is unexpected token else.


#2

Hi you closed the compare function before, so you should close it after the else statement after your first if statement remove one } and add one at the end it should be lie that

var compare = function() {
    if (condition) { 

    }
    else if (condition){
        if (condition) { 
        
        }
        else { 

        } 
    }
} <== This one close the compare function

#3

I dealt with the previous syntax error but why is the function saying "paper wins" now?


#4

Hi inside your compare call you should put userChoice and computerChoice like that

compare(userChoice,  computerChoice )

#5

The same outcome occurred. I think there's some problem with my else if statement since that's supposed to give me "rock wins"
but the computer disregards this section and goes straight to the else statement that gives "paper wins."


#6

Hi try to remove the

compare(userChoice,  computerChoice )

#7

fixed it. There was a typo with scissor on line 16.