TA贡献1817条经验 获得超14个赞
var A = [{a: 1}, {b: 2}, {c: 3}];//原始数据
var B = {};
A.forEach(function (item) {
var key = Object.keys(item);
B[key[0]] = item[key[0]];
});
A = B;
TA贡献1777条经验 获得超3个赞
A = A.reduce((x, y) => Object.assign(x, y))
大厂算法面试真题解析32讲
¥ 68.00
举报