6. what is choice 1 is rock? please help.i have tried so many times and even looked at Q/A forum . none could be my help


#1

var compare= function(choice1, choice2) {
    if (choice1===choice2)
    return "The result is a tie!";
    } {
else if (choice1 === "rock"){
    if else (choice2 === "scissors"){
        return "rock wins";
   } 
}
        else{
            return "paper wins";
        }
}

#2

var compare= function(choice1, choice2) {
if (choice1===choice2)
return "The result is a tie!";
} {

you close your function after the if case so all that comes after this is at a point where it should not be so maybe get back to 6/9 and have a look at the hint.


#3

It should be one line for "if" and one line for "else" like you did but the "else" under else if shouldn't be there.