Passing but nothing is in my preview screen


#1

I'm doing the rock, paper, scissors game and I keep passing onto the next steps but there is nothing showing up in my preview screen. Am I doing something wrong?

/*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(choice1, choice2) {
if(choice1 === choice2) {
return "The result is a tie!";}

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

else {return "paper wins";}

if (choice2 === "rock") {
return "paper";}

else {return "scissors wins";}

};

};


#2

Please read
http://www.codecademy.com/forum_questions/559dcb4be39efe550f00006b
and concentrate on

  • the build of IF ELSE-IF statement structure