The Math object allows you to perform mathematical tasks, like rounding numbers, generating random numbers, and performing power calculations. It is built-in and does not require creating an instance.
Math.round() - rounds to nearest integerMath.ceil() - rounds upMath.floor() - rounds downMath.min() - returns minimum valueMath.max() - returns maximum valueMath.pow() - power of a numberMath.random() - random number between 0 and 1Math.trunc() - removes decimal part [ES6]
console.log(Math.round(4.6)); // 5
console.log(Math.ceil(4.1)); // 5
console.log(Math.floor(4.9)); // 4
console.log(Math.min(1, 3, 0)); // 0
console.log(Math.max(1, 3, 0)); // 3
console.log(Math.pow(2, 3)); // 8
console.log(Math.random()); // 0-1
console.log(Math.trunc(4.7)); // 4
Click the button to see Math methods in action: