7. What if choice1 is paper


#1




HELP! So this is my code but it returns "syntax error: Unexpected end of script"

Replace this line with your 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";
    }      
}

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


#2

your function:

var compare = function(choice1,choice2)
{

the { of your function has no matching closing curly bracket (}), add } at the right place


#3

I got it! thanks so much, i looked at other topics and couldn't get the right solution


#4