Answers for "check what value is lowest by index javascipt array"

7

js find lowest number in array

const arr = [14, 58, 20, 77, 66, 82, 42, 67, 42, 4]
const min = arr.reduce((a, b) => Math.min(a, b))
console.log(min)
Posted by: Guest on April-18-2021
0

how to find the lowest number in an array in javascript for specific indexes

var index = 0;
var value = temp[0];
for (var i = 1; i < temp.length; i++) {
  if (temp[i] < value) {
    value = temp[i];
    index = i;
  }
}
Posted by: Guest on October-25-2020

Code answers related to "check what value is lowest by index javascipt array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language