Most useful javascript math functions

Software engineer | Web developer | Tech Enthusiast
abs
Math.abs function returns the absolute value of a number

ceil
Math.ceil function rounds a number up to the next largest integer

floor
Math.floor function rounds a number down to its nearest integer

round
Math.round function rounds a number to its nearest integer

trunc
Math.trunc function returns the integer part of a number

max
Math.max function returns the number with the largest value

min
Math.min function returns the number with the lowest value

pow
Math.pow function returns the base to the exponent power

sqrt
Math.sqrt function returns the square root of a number

cbrt
Math.cbrt function returns the cubic root of a number

random
Math.random return random number between 0 to 1

Bonus
sign
Math.sign return an argument is negative, positive or NaN

Wrapping up!
Share this blog with your friends π©πΌβπ€βπ§πΌ and developers π¨βπ» you know and let them know these
Your feedback and comments are very important to me. π



