Math.random() Method is used to return the random number between 0 inclusive but not 1 exclusive.
Syntax:
Math.random()
Example:
<script> var one = Math.random(); document.writeln('Output is : ' + one + '</br></br>'); var two = Math.random(); document.writeln('Output is : ' + two + '</br></br>'); var three = Math.random(); document.writeln('Output is : ' + three + '</br></br>'); var four = Math.random(); document.writeln('Output is : ' + four + '</br></br>'); </script>
Output:
Output is : 0.6772958513976521 Output is : 0.8799006679119346 Output is : 0.5298651974436075 Output is : 0.5920655796664953