Syntax error


var userChoice=prompt("Do you choose rock, paper or scissors?")
var computerChoice = Math.random();
if (computerChoice is <=.33) {
computerChoice = "rock";
else if (computerChoice is >=.34 && <=.66) {
computerChoice = "paper";
else {
computerChoice = "scissors";


Supposed to be >= instead of <= because you are looking at if the computerChoice is BELOW 0.33.

All you have to put for this is

else if (computerChoice >= 0.66){

The word is is not able to work in statements.

With your it, the code doesn't work because JS does not know what it means.


Yes the interpreter doesn't understand plain english so is would just be confused with a variable and then lacks meaning and context and therefor creates errors.

But @ragezapper the <= is correct as far as I can see. < means less than so <= means less than or equal to. >= would mean greater than or equal to. If you keep consequent in doing so you obviously create 3 cases as well but in different order.