Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ascending and descending val in array using js

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: #ascending #descending #val #array #js
ADD COMMENT
Topic
Name
7+2 =