Rock Paper Scissors? Syntax Error. Computer Choice Part 1


#1



Replace this line with your code.


#2

Here's my code

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

#3

You are creating a function. You need to have a variable userChoice equal to the prompt value.
Then the extra brackets in console.log has to go as well

Try it, and paste in your code if you still get an error


#4

what? ;;;;;;;;;;;;;;;


#5

You created a function with prompt in it..
You shouldn't have a function. What you need to do is declare the variable and set it equal to prompt


#6

ok Thannnnnnnnnnnnnnnnnnks


#7

If you still get an error then paste in your code and I will help you :slight_smile:


#8

now it says the m in math is important.
var userChoice = prompt("Do you choose rock, paper or scissors?");

var computerChoice = console.log(Math.random());


#9

Leave this part how it was just remove the two brackets from after computerChoice


#10

okkkkkkkkkkkkkkkkkkkkkkk. Thanks


#11

A post was split to a new topic: Computer Choice Part 1


#12