Answers for "how to find which value is the lowest in javascript"

3

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

javascript lowest number

function lowestNumber(numbers) {
  // typeof numbers parameter is array
  let lowest = numbers[0];
  for(let i = 1; i < numbers.length; i++){
    if(numbers[i] < lowest){
      lowest = numbers[i]
    }
  }
  return lowest;
}
Posted by: Guest on April-23-2021

Code answers related to "how to find which value is the lowest in javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language