Math.random

Returns a pseudo-random number between 0 and 1. The random number generator is seeded from the current time, as in Java.

Method of Math
Static

Syntax

random()

Parameters

None.

Description

Because random is a static method of Math, you always use it as Math.random(), rather than as a method of a Math object you created.

Examples

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.