Math Object in javascript
The Math object provides static methods and constants for numeric operations: rounding (round, floor, ceil, trunc), powers (pow), roots (sqrt), randomness (random), and useful constants like PI. It is not a constructor, so you never use new Math().
Example
Math.round(3.6); // 4
Math.floor(3.6); // 3
Math.ceil(3.1); // 4
Math.max(1, 5, 2); // 5
Math.min(1, 5, 2); // 1
// Random number between 0 and 9
const rand = Math.floor(Math.random() * 10);These helpers cover most common numeric tasks: rounding, min/max, and generating simple random integers.