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
It's not working because you are passing an array as the parameter instead of comma separated numbers. Try spreading the array like this:
data = [4, 2, 6, 1, 3, 7, 5, 3]; alert(Math.max(...data));