What's up with Unexpected Token: {


#1



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


Hey! Whenever i try to submit in, I receive a "Unexpected token: {"


var userChoice = prompt("Do you choose rock, paper, or scissors?")
var computerChoice = Math.random {
    if(Math.random <= 0.33) {
        return ("rock");
    }
    else if(0.33 < Math.random <= 0.66) {
        return ("paper");
    }
    else {
        return ("scissors");
    }
}


#2

1- Delete the {} after Math.random and write (); instead

2- write computerChoice = "....."; instead of return("...").

3- Write console.log(computerChoice); at the end.


#3
  1. Than he should delete } at the end of his code too :slight_smile:

#4

Of course :slight_smile:


#5

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