Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort js

numArray.sort((a, b) => a - b); // For ascending sort
numArray.sort((a, b) => b - a); // For descending sort
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #sort #js
ADD COMMENT
Topic
Name
8+2 =