Printing out computerchoice in computerchoice part1


#1

var userChoice = prompt("Do you choose rock, paper or scissors?")
var computerChoice = Math.random(0,1); { console.log("computerChoice");}
the output suggest I've not log computerchoice to the console.


#2

there shouldn't be a 0 or 1 there just keep it empty..
var computerChoice = Math.random()
Math makes a random number itself, it's gonna be either 0 or 1.

and Console.log isn't a function in this perticulair stage, so no {, } and no " "


#3

Thank you. So, I should just use this:
var userChoice = prompt("Do you choose rock, paper or scissors?")
var computerChoice = Math.random()


#4

and a
console.log (computerChoice)

to check if you r right, just "Save & submit code" you'll see for yourself :wink:


#5

yes, it worked thanks.. I'll let you know if I encounter another problem.


#6

No problem, if you can confirm that my answer is right than this post can be secured.

feel free to message me if you have more questions :wink:


#7

Yes, your answer is correct. Thanks..


#8

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