I am not getting what is the unexpected token here?


#1

var userChoice = prompt( "Do you choose \n1.rock \n2.paper \n3. scissors");

var computerChoice = Math.random();
console.log(computerChoice);

if (computerChoice < 0.33)
{computerChoice = "Rock";
console.log(computerChoice);}

else if (computerChoice > 0.34 && < 0.66)
{computerChoice = "Paper";
console.log(computerChoice);}
else(computerChoice > 0.67 && <= 1)
{computerChoice = "scissors";
console.log(computerChoice);}


#2

Of all the challenges introduced in the introduction to JavaScript track, this one is the most crash and burn. Thousands of hours have been spent on a misguided instruction... 'Between.' If this word had never been uttered, thousands of learners would have been spared the agony that this one challenge has caused.

Not that 'betweenness' is not a concern in programming, it just should not have been brought up here. This is a problem concerning order. Once that is sorted out, the logic is very straight forward. Order is the key.

For brevity, let c stand in for computerChoice

var c = computerChoice;
if (c < 1/3) {
    c = "rock";
} else
if (c < 2/3) {
    c = "paper";
} else {
    c = "scissors";
}
computerChoice = c;