What is Math?
The Math object includes several mathematical constants and methods.
Math object allows you to perform mathematical tasks.
Math is not a constructor, hence all properties and methods can be called by using Math as an object without creating it.
var a = Math.PI; //3.141592653589793 var b = Math.sqrt(25); //5
The random() method returns a random number from 0 to 1, but not 1.
It is defined in Math object.
var a = Math.random(); // here the value of a can be anything between 0 and 1 for example 0.6324468343159858
Click on below topics for step by step understanding.