6. what am I missing here


#1

what is wrong with this code

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

#2

Hi this part you should remove one } because it close the compare function..

if(choice1 === choice2) {
    return "The result is a tie!";
}
}< = this one

and add one at the end for closing the compare function.


#3

hi,

I tried it and it still shows a syntax error


#4

Hi can you post your new code?


#5

hi, there you go

var compare = function(choice1, choice2) {
if(choice1 === choice2)
}

else if( choice1 === "rock") {
    
    if( choice2 === "scissors") {
        return "rock wins";
    }
    else{
        return "paper wins";
    }
}

}


#6

hi sorry wrong code will post correct one now


#7

hi came right thank you


#8

Did you pass the Lesson?