I didnt get any Outout on lesson 6/9


#1

Please expansiate. I ran the below code but i got a blank output. Is it what is required of this task?

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

#2

Have a read
http://www.codecademy.com/forum_questions/559dcb4be39efe550f00006b
and concentrate on the IF ELSE-IF statement structure
and do not forget the closing-curly-bracket-} at the =End= with which you close the compare function.


#3

No, you are not supposed to get any number or word on the console.

Why? You see the */ and /*? Those indicate to the computer to ignore them. It's kind of like //, but in a much larger range.

You may have not noticed, but starting from 5/9, they made those codes to be ignored. That is why it isn't supposed to have an output on the console.

Hope it helped! :smiley:


#4

Thank a bunch...a lot clearer now.