Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sort

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

// [1, 2, 3, 4, 5]
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #js #sort
ADD COMMENT
Topic
Name
2+9 =