6 What if choice 1 is rock


#1

What is wrong?

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 closed the compare function earlier

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

#3

this code is working

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


#4

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

Problem is with first ELSE IF
please help