Why do I have the syntaxError: unexpected identifier?


#1

var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();

if (computerChoice < 0.34) {
computerChoice = "rock";
}
else if (computer choice <= 0.67){
computerChoice = "paper";
}
else {
computerChoice = "scissors";
};


#2

else if (computer choice <= 0.67){

here computer and choice are treated as 2 variable names and now the interpreter is confused as there is no operator relation between them. So just fix this typo.