JavaScript Math Object : random()

The random() method returns a random number between 0 and 1. Syntax :
  var x = Math.random();
Example :
<script>
  var x = Math.random();
  document.write(x + "<br/>");
  var x = Math.random();
  document.write(x + "<br/>");
  var x = Math.random();
  document.write(x + "<br/>");
</script>
Output :



Next Topic :