// 将一个JSON数组[{},{},{}]按一定规则合并到另一个JSON数组[{},{},{}] // Object.assign方法的第一个参数是目标对象,后面的参数都是源对象. var list1 = [{id:2,name:'aa'},{id:4,name:'bb'},{id:1,name:'cc'}]; var list2 = [{id:2,age:10,sex:'男'},{id:1,age:18,sex:'男'},{id:4,age:16,sex:'女'}]; var arr = [