Unexpected number error


#1

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

i have no idea why it says that i have an unexpected number, because i made sure that the numbers used were numbers that were given to me.


#2

@mr_trickster take a look at these posts to get an idea where you are going wrong
Click here

or
Click here


#3

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
var tie = true;
if (0.34>computerChoice){
computerChoice = "rock"; };
else if (0.66=>computerChoice) {
computerChoice = "paper"; };
else { computerChoice = "scissors"; };
console.log("Computer: " + computerChoice);

i put this and it says Unexpected token else, do you know why ?


#4

its ok now i got ti done, but if you can explain the errors on this one that would be helpful.


#5

see how you do this

if (0.34>computerChoice)

and this

else if (0.66=>computerChoice)

the computerChoice is supposed to come first and then the number second in the comparison
also the comparison operators are written as like this >= , <= , !==