Y
Yansky
Hi, just a quick question about the Math.min() function.
If I have an array of numbers:
var tempArray = [12,45,2,67,86];
how come Math.min() can't look at all the numbers in the array at
once? i.e. - If I put all of the numbers in the array like so:
Math.min(12,45,2,67,86)
I get the lowest number, but when I try this:
Math.min(tempArray)
I get an error of NaN.
Cheers.
If I have an array of numbers:
var tempArray = [12,45,2,67,86];
how come Math.min() can't look at all the numbers in the array at
once? i.e. - If I put all of the numbers in the array like so:
Math.min(12,45,2,67,86)
I get the lowest number, but when I try this:
Math.min(tempArray)
I get an error of NaN.
Cheers.