Return a random number between 0 (inclusive) and 1 (exclusive):
More "Try it Yourself" examples below.
Definition and Usage
The random() method returns a random number from 0 (inclusive) up to but not including 1 (exclusive).
|Return Value:||A Number, representing a number from 0 up to but not including 1|
Return a random number between 1 and 10:
Return a random number between 1 and 100: