Math.max() expects numbers arr is not a number, but an array, so writing Math.max(arr) you are feeding something that is not a number to a method that expects a number, so it returns NaN
Math.max.apply(null, arr) is a way to use a method that accepts multiple arguments with an array.
The spread operator spread the array to multiple arguments when you do Math.max(...arr) so that’s not needed anymore.
It can be confusing if you don’t already know how it was done before.