get min element from array js code example
Example 1: min array javascript
const nums = [1, 2, 3]
Math.min(...nums) // 1
Math.max(...nums) // 3
Example 2: javascript index of min value in array
arr = [11, 10, 10];
var index = arr.indexOf(Math.max(...arr));