Computer Choice: Part 2


#1


I cannot wrap my head around what is wrong. I know lots of similar problems but i have tried comparing no difference.Help. Tq.

https://www.codecademy.com/courses/javascript-beginner-en-Bthev-mskY8/0/4?curriculum_id=506324b3a7dffd00020bf661#


Oops, try again. There was a problem with your syntax.


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

if (computerChoice < 0.34 ){
     computerChoice = "rock";
    }
elseif (computerChoice <=  0.66){
    computerChoice = "paper";
    }
else {
    computerChoice = "scissors";
    }


#2

Put a space between else and if!


#3

Because of a typo... Thanks!


#4

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