Math.min.apply code example
Example 1: javascript math min array
const nums = [1, 2, 3]Math.min(...nums) // 1Math.max(...nums) // 3
Example 2: apply() js
The apply() method accepts arguments in an array:
var arr = [6, 89, 3, 45];
var maximus = Math.max.apply(null, arr); // returns 89