Answers for "sort() function example JavaScript"

52

sort javascript array

var points = [40, 100, 1, 5, 25, 10];
points.sort((a,b) => a-b)
Posted by: Guest on June-07-2020
-1

sort() function example JavaScript

function ascendingOrder(arr) {
  return arr.sort(function(a, b) {
    return a - b;
  });
}
ascendingOrder([1, 5, 2, 3, 4]);
Posted by: Guest on April-24-2021
-2

how to sort array

array sorting
Posted by: Guest on February-28-2021

Code answers related to "sort() function example JavaScript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language