1,如何将数组arr1转化成arr2?
arr1 = [
['tracking1','abc@qq.com','80'],
['tracking1','abc@qq.com','50'],
['tracking2','efg@qq.com','60'],
['tracking2','efg@qq.com','30'],
];
arr2 = [
['tracking1','abc@qq.com',['80','50']],
['tracking2','efg@qq.com',['60','30']],
];
思路很简单,就是把数组的第一和第一列的值作为一个唯一
key
写入,感觉楼上代码有点多,简洁代码如下