Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

sort string array object javascript

obj.sort(function(a,b){
  if(a.last_nom< b.last_nom) return -1;
  if(a.last_nom >b.last_nom) return 1;
  if(a.first_nom< b.first_nom) return -1;
  if(a.first_nom >b.first_nom) return 1;
  return 0;
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #sort #string #array #object #javascript
ADD COMMENT
Topic
Name
6+5 =