Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sort integer array

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

// decending (reverse)
numArray.sort((a,b) => b-a);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #sort #integer #array
ADD COMMENT
Topic
Name
9+4 =