What does the Math object provide?
Math is a namespace of static functions for numeric work. Nothing on it needs a receiver, so every call is written as a method on Math itself.
console.log(Math.max(3, 1, 7)); // 7
console.log(Math.min(3, 1, 7)); // 1
console.log(Math.round(2.5)); // 3
console.log(Math.floor(2.9)); // 2
console.log(Math.ceil(2.1)); // 3
console.log(Math.trunc(-2.9)); // -2
console.log(Math.abs(-5)); // 5
console.log(Math.pow(2, 10)); // 1024
console.log(Math.sqrt(16)); // 4
console.log(Math.sign(-3)); // -1The rounding family is the part worth understanding properly, because the members differ on negative numbers. Floor always rounds towards negative infinity, so it goes down. Ceil always rounds towards positive infinity, so it goes up. Trunc drops the fractional part, so it goes towards zero. And round rounds to the nearest integer, with halfway cases going towards positive infinity, which means a negative halfway value rounds up towards zero.
On top of those there are the numeric limits. The maximum safe integer is the largest integer that can be represented exactly as a double, which is nine quadrillion and change. Anything above that loses precision, and the maximum value itself is a much larger number that is not an integer. The epsilon constant is the gap between one and the next representable number, and it is the standard trick for correcting floating point rounding errors.
Math also holds the trigonometric functions, the logarithm and exponential functions, the hyperbolic variants, and a handful of helpers such as the sign function and the random number generator.