Stuck on 7. What if the choice1 is paper?


I've tried looking through the other threads, but can't seem to find the mistake(s) myself. If someone with more experience could please review my work point out my mistake(s) I'd really appreciate it! Thanks!


HI you didn't close the first else if statement

else if (choice === "rock") {
   #here put the else and if statement


Thanks so much! Feel so silly for missing it now.


Hello, I am also having problem with my code. It show an " Syntaxerror: Unexpected token else".
I can't figure out what the problem is!

I really appreciate some help!


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

                return "scissors wins" ;



HI you should remove the ; at all your closing } inside the compare function then you have more } than you need at the end remove one.


Solved.. lesson learnd!

Thanks Wizmarco


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