标签:orderby function ++ logs span erb var func return
orderedUsers: function () { var arr = this.users; for (var i = 0; i < arr.length - 1; i++) { for (var j = i + 1; j < arr.length; j++) { var tmp = arr[i]; if (arr[i].name.split(‘‘)[0] > arr[j].name.split(‘‘)[0]) { tmp = arr[i]; arr[i] = arr[j]; arr[j] = tmp; } } } return arr; }
标签:orderby function ++ logs span erb var func return
原文地址:http://www.cnblogs.com/theWayToAce/p/7340739.html