Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript how to sort alphabetically

users.sort((a, b) => a.firstname !== b.firstname ? a.firstname < b.firstname ? -1 : 1 : 0);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #javascript #sort #alphabetically
ADD COMMENT
Topic
Name
4+1 =