Answers for "js array.sort by"

0

js sort

let numbers = [4, 10, 5, 1, 3];
numbers.sort((a, b) => a - b);
console.log(numbers);

// [1, 2, 3, 4, 5]
Posted by: Guest on May-10-2021

Browse Popular Code Answers by Language