标签:style blog ar io color sp for on div
var helper = {
sort:function(data){ //{“20141216”:{},“20141217”:{}}按大小排序, var arr1 = [],arr2=[],self = this; for(var key in data){ arr1.push(key); } arr1.sort(); for(var i=0;i<arr1.length;i++){ var date = arr1[i]; var o = self._clone(data[date]); o.date = arr1[i]; o.flag = o.hasOwnProperty(‘img‘); arr2.push(o); } return arr2; }
}
key值为数字字符的对象,按数字大小顺序排序|自定义obj.sort函数|为对象排序
标签:style blog ar io color sp for on div
原文地址:http://www.cnblogs.com/liujinyu/p/4167062.html