Answers for "sum the two first minimum numbers in an array"

0

sum the two first minimum numbers in an array

function sumTwoSmallestNumbers(numbers){
    function sortNumber(a , b){
        return a - b
    }
    numbers.sort(sortNumber)
    // console.log(numbers)
    return numbers[0] + numbers[1]
}
// sumTwoSmallestNumbers([5, 8, 12, 19, 22])
sumTwoSmallestNumbers([15, 28, 4, 2, 43])
Posted by: Guest on October-09-2021

Code answers related to "sum the two first minimum numbers in an array"

Code answers related to "Javascript"

Browse Popular Code Answers by Language