1. abs(x) - Gets positive value of x
document.write(Math.abs(-1));
Output : 1
Output : 1
2. ceil(x) / round(x) - Gets x rounded up to the nearest integer
document.write(Math.ceil(3.7));
or, document.write(Math.round(3.7));
Output : 4
Output : 4
3. floor(x) - Gets x rounded down to the nearest integer
document.write(Math.floor(3.7));
Output : 3
Output : 3
4. max(x,y,z,....) - Gets the maximum value of the given arguments
document.write(Math.max(6,2,10,4,5,9));
Output : 10
Output : 10
5. min(x,y,z,....) - Gets the minimum value of the given arguments
document.write(Math.min(6,2,10,4,5,9));
Output : 2
Output : 2
6. pow(x,y) - Gets x to the power of y (x^y)
document.write(Math.pow(2,3));
Output : 8
Output : 8
7. random() - Generates random number between 0 and 1
document.write(Math.random());
Output : 0.6635743035574985
Output : 0.6635743035574985
8. sqrt() - Gets the square root of x
document.write(Math.sqrt(25));
Output : 5
Output : 5