JavaScript8 min read
JavaScript Number Methods and Math
Master JavaScript number methods and Math object. Learn rounding, parsing, and calculations.
Alex Thompson
December 19, 2025
0.0k0
JavaScript Number Methods and Math
Number Methods
```javascript const num = 123.456;
num.toFixed(2); // "123.46" num.toString(); // "123.456" parseInt('123'); // 123 parseFloat('123.45'); // 123.45 ```
Math Object
```javascript Math.max(5, 10); // 10 Math.min(5, 10); // 5 Math.round(4.7); // 5 Math.floor(4.7); // 4 Math.ceil(4.2); // 5 Math.random(); // 0 to 1 Math.abs(-5); // 5 Math.sqrt(16); // 4 Math.pow(2, 3); // 8 ```
Key Takeaway
Number methods format numbers. Math object provides calculations. Essential for numeric operations.
#JavaScript#Numbers#Math#Beginner