applybeginnerconst nums = [5, 1, 9, 3]
Math.max.apply(null, nums) // β 9Use apply() to spread an array as individual arguments to a function.
Because apply() spreads an array as arguments, it is perfect for calling Math.max with an array of numbers.
Challenge: Use Math.max.apply(null, [1, 5, 3]) and verify the result is 5.