JS数组排序-按照KEY的数字或者ascii码排序

 

2、按字符的ASCII码比较

 

//注意:这里将key转成了字符串类型 eidtionTypeList.sort(function(a,b){return a.key+"">b.key+"";}); console.log(eidtionTypeList);

 
  

引用:http://www.cnblogs.com/snandy/archive/2011/03/02/1968580.html

你可能感兴趣的:(function)