Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort object alphabetically javascript

objArray.sort(function(a, b) {
    var textA = a.DepartmentName.toUpperCase();
    var textB = b.DepartmentName.toUpperCase();
    return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #object #alphabetically #javascript
ADD COMMENT
Topic
Name
2+4 =