const arr = [10, 5, 0, 15, 30];
const min = Math.min.apply(null, arr);
const index = arr.indexOf(min); // get the index of the min in the array
console.log(index); // 2
const nums = [1, 2, 3]Math.min(...nums) // 1Math.max(...nums) // 3
var min = Math.min.apply(null, arr),
max = Math.max.apply(null, arr);
int min=0;
for(int i=0;i<array.length;i++)
{
if(array[i] < min)
min = array[i]
}
return min;