I am trying to get the highest number from a simple array:
data = [4, 2, 6, 1, 3, 7, 5, 3]; alert(Math.max(data));
I have read that if eve
If you have to use the Math.max function and one number of the array might be undefined, you could use:
x = Math.max(undefined || 0, 5) console.log(x) // prints 5