- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# What is math object in JavaScript?

The math object has 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.

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

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

You can try to run the following code to learn how to implement math object in JavaScript. Here, we’re working on Math PI property to return the ratio of the circumference of a circle to its diameter which is approximately 3.14159 −

## Example

<html> <head> <title>JavaScript Math PI Property</title> </head> <body> <script> var property_value = Math.PI document.write("Property Value (PI) : " + property_value); </script> </body> </html>

## Output

Property Value (PI) : 3.141592653589793

- Related Questions & Answers
- What is Math Object in JavaScript Program?
- JavaScript Math Object example
- What are JavaScript Math Functions?
- What is JavaScript object Destructuring?
- What is date object in JavaScript?
- What is arguments object in JavaScript?
- What is WeakSet Object in JavaScript?
- Math. fround() function in JavaScript
- Math. hypot() function in JavaScript
- What is a Global Object in JavaScript?
- What is an Object Oriented Programming in JavaScript?
- What is the role of Navigator object in JavaScript?
- What is the use of proxy() object in JavaScript?
- What is the importance of Navigator Object in JavaScript?
- What is the use of map object in javascript?

Advertisements