Exercise 7 on "Rock, Paper, Scissors!"


#1


I am stuck on exercise 7 on "Rock, Paper, Scissors!"

I keep getting a syntax error here, help!


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


#2

Check your brackets. Make sure that the beginning 'if' statement had a beginning opening '{' bracket. Also take off the dot on the last closing '}' bracket.

New code should look like this:


#3

I've done this, but it still doesn't work.

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


#4

Hi You should put this
And You should Close The " After rock

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

Inisde the compare function

var compare = function(choice1, choice2) {#open the compare function 

#here You should put all the if, else if And else  statement 

}#Close The compare function