添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

<script language="javascript">
var eidtionTypeList = [
{key:104212,val:"影刻本"},
{key:104211,val:"翻刻本"},
{key:104210,val:"重刻本"},
{key:110,val:"局本"},
{key:109,val:"殿本"},
{key:108,val:"藍印本"},
{key:107,val:"朱印本"},
{key:106,val:"套印本"},
{key:105,val:"活字印本"},
{key:104,val:"刻本"},
{key:103,val:"抄本"},
{key:102,val:"寫本"},
{key:101,val:"稿本"},
{key:100,val:"123123"} ,
{key:100,val:"123123"}
];


1、按key大小排序

eidtionTypeList.sort(function(a,b){return a.key>b.key;});
console.log(eidtionTypeList);
</script>

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

版权声明:本文为CSDN博主「adparking」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接: https://blog.csdn.net/adparking/article/details/6433017