Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #find #smallest #numbers #array #javascript
ADD COMMENT
Topic
Name
2+8 =