JavaScript7 min read

JavaScript Math Operations

Master JavaScript Math object. Learn mathematical operations, rounding, random numbers, and calculations.

Alex Thompson
December 19, 2025
0.0k0

JavaScript Math Operations

Math Object

Math.max(5, 10, 3);      // 10
Math.min(5, 10, 3);      // 3
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

Random Numbers

Math.random();                    // 0 to 1
Math.floor(Math.random() * 10);   // 0 to 9
Math.floor(Math.random() * 100) + 1; // 1 to 100

Key Takeaway

Math object provides mathematical functions. Use for calculations, rounding, random numbers. Essential for any numeric operations.

#JavaScript#Math#Numbers#Beginner