javascript game math.random

Rock, Paper, Scissors...

In part 2 of Lesson 2 you get to build a little rock, paper, scissors game. It introduces a new item - the random method on Math.

math.random()

I was curious, because they don't really explain it. Just looking at the command itself it looks like it has two parts math and random. I kind of assume that means it's a command of the type "math", and its specific function is creating a random number. Turns out I'm right: it's called a method and in this case it picks a number between 0 and 1.

Subscribe to RSS - javascript game math.random