Stuck stuck stuck


#1

Been working on if for about a week and a half.

SyntaxError: Unexpected token else

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"){
}
else{
return "scissors wins
}
}

Replace this line with your code.


#2

here:

else if(choice1 === "rock"){
 // if and else for choice 2 here
}

checking for choice2 should happen inside else if, not after


#3

I changed it up. Still with syntax error.
As a side note: The top portion allowed me to proceed the (choice1 === paper) ran into a brick wall lol

Thanks for the help

SyntaxError: Unexpected token else

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")
}
else{
return "scissors wins"
}


#4

Got it!!!!! Thanks for your help


#5