1.

What Is Javascript Math Object?

Answer»

The math object provides you properties and methods for mathematical constants and FUNCTIONS. Unlike other global objects, Math is not a constructor. All the properties and methods of Math are STATIC and can be called by using Math as an object without creating it.

THUS, you refer to the constant pi as Math.PI and you call the sine function as Math.sin(x), where x is the method's argument.

SYNTAX: The syntax to call the properties and methods of Math are as follows

var pi_val = Math.PI;
var sine_val = Math.sin(30);

The math object provides you properties and methods for mathematical constants and functions. Unlike other global objects, Math is not a constructor. All the properties and methods of Math are static and can be called by using Math as an object without creating it.

Thus, you refer to the constant pi as Math.PI and you call the sine function as Math.sin(x), where x is the method's argument.

Syntax: The syntax to call the properties and methods of Math are as follows

var pi_val = Math.PI;
var sine_val = Math.sin(30);



Discussion

No Comment Found