It says syntax error


var userChoice=prompt("Do you choose Rock, Scissor or Paper");
var computerChoice = Math.random();

if (computerChoice =<0.33) {

else if (computerChoice=>0.33 && =<0.66) {

else if (computerChoice =>0.66 && =<1) {

whats wrong with this?
it says syntax error

Help #4!

You should be doing computerChoice = "rock";

computerChoice = "paper";

computerChoice = "scissor;"

Try this and pls say exact error you're getting. Syntax error could be wide.

Stuck in Buld rock paper scissors game

@bayoishola20 is right, you want to set a computerChoice so you can use this later to compare with the userChoice.

Also, your && comparison is not completely right, take a look here why not. You don't really need the && operator, if the if condition is true, else if and else will never run. So in else if you can simple check if the number is .66 or less, no need to use the and operator


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