Answers for "how to find smallest number in array js"

10

how to find smallest number in array js

const arr = [14, 58, 20, 77, 66, 82, 42, 67, 42, 4]
const min = Math.min(...arr)
console.log(min)
Posted by: Guest on February-16-2020
1

how to find the smallest two numbers in an array javascript

function sumTwoSmallestNumbers(numbers) {  
  numbers = numbers.sort((a, b) => {
    return a - b; });
};  //this will turn the numbers list into the 2 lowest numbers
Posted by: Guest on October-08-2020
1

how to find smallest number in array js

Array.min = function( array ){
    return Math.min.apply( Math, array );
};
Posted by: Guest on November-25-2020

Code answers related to "how to find smallest number in array js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language