js get min value from array code example
Example 1: javascript get minimum value in array
var arr = [5,1,9,5,7];
var min = Math.min(...arr);
console.log(min);
var arr = [5,1,9,5,7];
var min = Math.max(...arr);
console.log(min);
Example 2: javascript index of min value in array
arr = [11, 10, 10];
var index = arr.indexOf(Math.max(...arr));
Example 3: javascript find the min in array of numbers
let arrayOfIntegers = [9, 4, 5, 6, 3];
let min = Math.min(...arrayOfIntegers);
Example 4: javascript math min array
const nums = [1, 2, 3]Math.min(...nums)