ComputerChoice: Part 2


#1

Hello, guys!
Need some help with my code. Look at it, please. Any ideas?

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


#2

HI the orderof teh if , else statement is that

if (condition) {

}
else if (condition) {

}

else {

}

the else statement should be at the end


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.