Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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