The apply() method of Function object calls the function with a given this value and arguments provided as an array (or an array-like object).
const numbers = [5, 6, 7, 3, 2];
const max = Math.max.apply(null, numbers);
console.log(max);
// 7