Plase help trying to break my head on this!


#1


lesson 7


SyntaxError: Unexpected token else, i dont how to fix it?? dopes anyone else see a problem here?


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


#2

here:

if(choice2 === "scissors"){
        return "rock wins"};
    } // closes else if

you already close else if, but else should also be nested inside else if


#3

Ohhhh i see it now! Really love your website. Quick question to you. If i upgrade to pro user on your website will you guys be able to teach me all aspects of the desired languages?


#4

Well, there is the community on the forum, you can ask anything in the corner bar, most are answers. Anything related to the exercises you can ask under that track on the forum. Then there are the advisors which are part of pro, of which i have no idea how far they will go to help you.


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.