Absolute function is a function that generates an absolute value or absolute .
var x = Math.abs(-2)
Variables xwill be valuable 2, because the function abs() will always provide absolute or positive values.
The minimum and maximum functions are functions to determine the smallest and largest value in a set of values.
We can give this function input in the form of a number.
If we want to provide an input array, we have to break the array of contents.
Pay attention to the operator ..., this is the operator added to the ES2015 which functions to break the contents of arrays and strings.
Constants in the Math Object
In addition to providing mathematical functions, objects Mathalso provide constants such as PI, E, LN10, etc. which we can use for calculating certain formulas. 3
Math.E// returns Euler's number
Math.PI// returns PI
Math.SQRT2// returns the square root of 2
Math.SQRT1_2// returns the square root of 1/2
Math.LN2// returns the natural logarithm of 2
Math.LN10// returns the natural logarithm of 10
Math.LOG2E// returns base 2 logarithm of E
Math.LOG10E// returns base 10 logarithm of E