Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

min of an array javascript

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
 
PREVIOUS NEXT
Tagged: #min #array #javascript
ADD COMMENT
Topic
Name
2+4 =