Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Sort in array in Javascript

const ascending: any= values.sort((a,b) =>  (a > b ? 1 : -1));
const descending: any= values.sort((a,b) => (a > b ? -1 : 1))
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Sort #array #Javascript
ADD COMMENT
Topic
Name
8+1 =