Next object under the category of global objects in JavaScript is Math. It is the JavaScript object that is used to make mathematical calculations on the web.
We can call properties and methods of this object without instantiation of this object because the Math object cannot be instantiated.
CODE/PROGRAM/EXAMPLE
document.write("Math.PI: " + Math.PI);
document.write("Math.SQRT2: " + Math.SQRT2 );
document.write(
"Math.max(10,20,20.4,20.6,30.5): " +
Math.max(10, 20, 20.4, 20.6, 30.5));
document.write(
"Math.min(10,20,20.4,20.6,30.5): " +
Math.min(10, 20, 20.4, 20.6, 30.5));
document.write("Math.ceil(20.4): " + Math.ceil(20.4));
document.write(
"Math.floor(20.4): " + Math.floor(20.4));
document.write("Math.random(): " + Math.random());
document.write(
"Math.round(30.5): " + Math.round(30.5) );
document.write("Math.sqrt(9): " + Math.sqrt(9));