Undefined


#1



It returns
Your code returned 'You Lose' instead of 'undefined' when the inputs are scissors and rock

Excersise 8


var userChoice = prompt("Do you choose rock, paper or scissors?");
var compare=function(userChoice,computerChoice)
{
    if (userChoice === computerChoice) {
        return "The result is a tie!";
    }
    else if (userChoice === "rock") 
    {
        if (computerChoice === "scissors")
        {
            return "You win!";
        }
        else 
        {
            return "Computer wins!";
        }
    }
    else if (userChoice === "paper") 
     {
        if (computerChoice === "rock") 
        {
            return "You win!";
        }
        else
        {
            return "Computer wins!";
        }
    }
    else if (userChoice === "scissors") 
    {
        if (computerChoice === "rock") 
        {
            return "You Lose";
        }
        else 
        {
            return "You win!"
        }
    }    
}
var computerChoice = Math.random();
if (computerChoice < 0.34) {
	computerChoice = "rock";
} else if(computerChoice <= 0.67) {
	computerChoice = "paper";
} else {
	computerChoice = "scissors";
}
console.log(compare(userChoice,computerChoice));


#2

The error message is wrong, but it's correct in that your return value is not right. Check the instructions for what the return value is supposed to be.