- Home
- /
- Tutorials
- /
- JavaScript Tutorial
- /
- JavaScript Math Object
JavaScript Numbers & Math
JavaScript Math Object
Mathis a built-in object holding mathematical constants and functions.
You never create a Math object; everything on it is static.
Call the methods directly on Math.
Example
Example
javascript
console.log(Math.abs(-5));
console.log(Math.sqrt(16));
console.log(Math.PI);The output is 5, 4, then pi.
