标签:rip script alert blog asc turn cti log div
var arr = [2,10,6,9,7,8]; var arr1 = arr.sort(); var arr2 = arr.sort(function(a,b){ if (a>b){ return -1; }else if(a<b){ return 1 } }); alert(arr1);//10,9,8,7,6,2 alert(arr2);//10,9,8,7,6,2 alert(arr);//10,9,8,7,6,2
标签:rip script alert blog asc turn cti log div
原文地址:http://www.cnblogs.com/xuhaodong/p/x11.html