Unexpected Token Error


#1

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

it says unexpected token ????


Computer Choice: Part 1
#2

Well this is not how functions work:

var name = function(parameter){
    code;
};

where parameter is a variable name that is optional.
And neither is it how you use Math.random() where Math.random() just creates a random number by writing Math.random(). No arguments (the things in () after the function name in the function call e.g. here "rock") required as Math.random has no parameters.

The idea is that you want to assign a string to computerChoice randomly so the first step is to get the random factor which just means that you assign Math.random() to computerChoice and that is all for now the interesting stuff will follow in the next exercises.