Computer Choice: Part 2 Syntax Error


#1

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

SyntaxError unexpected token {
Can anyone advise on what I'm doing wrong, please?


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

If (computerChoice <= 0.33) {
    computerChoice ="rock";
} else if (computerChoice <= 0.67 && computerChoice >= 0.34) {
    computerChoice ="paper";
} else {
    computerChoice = "scissors";
    }


#2

write if not If

remember javascript is case-sensetive


#3

Oh for the love all things, thank you so much. I can't believe I missed that.


#4

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