<script type="text/javascript"> var sdts = [ {name:"小明",age:30}, {name:"小红",age:20}, {name:"小花",age:40} ] function compare(property,desc) { return function (a, b) { var value1 = a[property]; var value2 = b[pro
1.定义函数 /** * 数组对象排序函数 * @param {any} name 排序字段 * @param {any} order 升.降(这里事true.false记得处理下) */ var by = function (name,order) { return function (o, p) { var a, b; if (typeof o === "object" && typeof p === "object" && o