According to the docs here, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max I should be able to use an array, right?
https://jsfiddle.net/utkLh4p6/
var a = [875, 551];
console.log( Math.max(a) ); // NaN
According to the docs here, https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/max I should be able to use an array, right?
https://jsfiddle.net/utkLh4p6/
var a = [875, 551];
console.log( Math.max(a) ); // NaN
You may think you can pass an array because of the syntax:
Math.max([value1[, value2[, ...]]])
The brackets in this syntax indicate that the value is optional, not that it is a member of an array.