Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sort number array

// ascending (normal)
numArray.sort((a,b) => a-b);

// decending (reverse)
numArray.sort((a,b) => b-a);
Source by practicum.yandex.com #
 
PREVIOUS NEXT
Tagged: #js #sort #number #array
ADD COMMENT
Topic
Name
8+6 =