vendredi 6 février 2015

SyntaxError: Unexpected token { in rock paper scissors

I'm getting the error "SyntaxError: Unexpected token {" and i don't know why, since everythin seems pretty right ! Could you help me ?



var userChoice = prompt("Choose: rock, paper or scissors?");

var computerChoice = Math.random();

if(computerChoice >= 0 && computerChoice <= 0.33){
computerChoice === "rock";
}

else if (computerChoice >= 0.34 && computerChoice <= 0.66){
computerChoice === "paper";
}

else (computerChoice >= 0.67 && computerChoice <= 1){
computerChoice === "scissors";
}

Aucun commentaire:

Enregistrer un commentaire