JavaScript program that sort an array of integers in ascending order
Posted by SceDev
Last Updated: February 17, 2024

Write a JavaScript program that sort an array of integers in ascending order.

function sortNumArrAsc(arr) {
    return arr.sort((x, y) => x - y);
  }
  
  console.log(sortNumArrAsc([5, 2, 1, 3, 4, 10, 15, 20, 9, 23, 11, 10]));