Answers for "array of numbers and outputs the maximum number."

0

largest and smallest number in an array 1-100 javascript

let numArray = [95, 1, 75, 7, 12, 50, 3, 88]
numArray.slice().sort(function(a, b) {
  return a - b
})
console.log('smallest: ' + numArray[0] + ', largest: ' + numArray[numArray.length - 1])
Posted by: Guest on November-09-2020
0

javascript index of biggest number

arr.indexOf(Math.max(...arr))
Posted by: Guest on December-20-2019

Code answers related to "array of numbers and outputs the maximum number."

Code answers related to "Javascript"

Browse Popular Code Answers by Language