JS: Math. max, min
max
Math.max(args)-
Return the largest of the arguments.
console.log(Math.max(24, 18, 5)); // 24 const xar = [24, 18, 5]; console.log(Math.max(...xar)); // 24
min
Math.min(args)-
Return the smallest of the arguments. e.g.
Math.min(...xArray)
JavaScript. math functions.
- JS: Math (namespace)
- JS: Math. max, min
- JS: Math. sign, abs
- JS: Math ceiling, floor, round, truncate
- JS: Math. random
- JS: Power and Roots
- JS: Math exponential and logarithm
- JS: Math constants. pi, e, sqrt, etc.
- JS: Math trig functions. sin, cos, tan, asin, acos, atan
- JS: Math hyperbolic functions. sinh, cosh, tanh, etc.
- JS: Math fround, clz32, imul