What if choice 1 is scissors> lesson 8 :(


#1



https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/1/4?curriculum_id=506324b3a7dffd00020bf661


"Oops, try again. Your code returned 'scissors win!' instead of 'undefined' when the inputs are scissors and rock"


var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
	computerChoice = "rock";
} else if(computerChoice <= 0.67) {
	computerChoice = "paper";
} else {
	computerChoice = "scissors";
} console.log("Computer: " + computerChoice);

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


#2

see your code you have to close else if statement after the else statement but you did
before

else if(userChoice === "paper"){
if(computerChoice === "rock"){
return "paper wins!";
}
} // you closed here,remove it
else{
return "scissors win!";
}
// you have to close here

then call the compare function


#3

thank you so much RCODEMAN!!!!!! <3 <3 <3
been stuck in days with this lesson. :frowning:
god bless your soul!