Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JS array sort

numArray.sort((a, b) => a - b); // For ascending sort
numArray.sort((a, b) => b - a); // For descending sort
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #JS #array #sort
ADD COMMENT
Topic
Name
5+6 =