代码如下: //定义一个对象数组 var data = [{ name: “jiang”, age: 22 }, { name: “AAAAAAAAAAAAAA”, age: 21 }, { name: “CCCCCCCCc”, age: 25}]; //定义一个比较器 function compare(propertyName) { return function (object1, object2) { var value1 = object1[propertyName]; var value2 = object2[propertyName]; if (value2 <