Please help with Rock paper scissors?


#1

I am trying to figure this out on my own but after an hour of re-typing the same code I've changed my mind. Please help!!!
This is what I have
var compare = function (choice1, choice2) {
if (choice1 === choice2) {
return "The result is a tie!";
}
else if (choise1 === "rock") {
if (choise2 ==="paper") {
return "paper wins";
}
else (choise2 === "scissors") {
return "rock wins";
}
}
}


#2

You appear to have an extra } at the end.


#3

the word 'choice' is also misspelled


#4

Thank you.
Just figured it out.
Thanks for not ignoring me.


#5

you are giving conditions to an else statement and you need a ; on the very last }

also your else if says:

else if (choise1 === "rock") {
    if (choise2 === "paper") {

when it should say:

else if (choice1 === "rock") {
    if (choice2 === "paper") {

hope this helps


#6

Thank you all so much. I just completed the lesson.