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 stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #sort #number #array
ADD COMMENT
Topic
Name
6+1 =