JS Math Max - ashish9342/FreeCodeCamp GitHub Wiki
The Math.max() function returns the largest of zero or more numbers.
Math.max(value1, value2, ...)value1, value2 and other arguments should be numbers. All arguments are optional.
If no arguments are given, the result is Infinity. If at least one of arguments cannot be converted to a number, the result is NaN.
Math.max(); // Infinity
Math.max('a'); // NaN
Math.max(NaN); // NaN
Math.max(5); // 5
Math.max(10, 20); // 20
Math.max(-10, -20); // -10
Math.max(-10, 20); // 20var x = Math.max(107 - 3, 48 * 90);
document.write(x);
// Output:
// 4320