Last lesson 8


#1


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


It's passing through but its not returning who wins.


 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";
}  



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

  else   {
        if (computerChoice === "scissors")
        return "rock wins"
        }
    };


#2

nvm - I forgot to add "compare(userChoice, computerChoice);" at the end.


#3