Q:

function executed by .apply() works with array, but does not the original function

if Math.max([1,3,9]) returns error (needs a list of numbers, not an array), why calling it via apply like below works?
function getMaxOfArray(numArray) {
 return Math.max.apply(null, numArray);
}

getMaxOfArray([1,3,9]) //9 
getMaxOfArray(1,3,9) //error

I understand .apply passes an array, but why should max function work with them only when called via apply? is there some internal transformation array => list ?

A:

apply expects the parameters to be in an array. if you just have the parameter list how you do in the second case, use call instead
Math.max.apply(null,[1,3,9])
Math.max.call(null,1,3,9)

What is the difference between call and apply? goes into a good amount of detail on the difference between call and apply

