Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js sort by name

users.sort(function(a, b){
    if(a.firstname < b.firstname) { return -1; }
    if(a.firstname > b.firstname) { return 1; }
    return 0;
})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #sort
ADD COMMENT
Topic
Name
5+9 =