Definition and Usage The random() method returns a random number between 0 and 1. Syntax Math.random() Example In this example we ...
Definition and Usage
The random() method returns a random number between 0 and 1.Syntax
Math.random() |
Example
In this example we will get a random number between 0 and 1:<script type="text/javascript"> document.write(Math.random()); </script> |
The output of the code above can be:
0.29183834001354014 |