Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort array by a value js

    arr.sort((a, b) => (a.nameofKeyFromArray < b.nameofKeyFromArray ? -1 : Number(a.nameofKeyFromArray > b.nameofKeyFromArray)));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #array #js
ADD COMMENT
Topic
Name
6+3 =