let array1 = [{name:"ABC",add:"XYZ"},{name:"PQR",add:"CCC"}];
let array2 = [1,2]
我希望输出是
array1=[{name:"ABC",add:"XYZ",num:1},{name:"PQR",add:"CCC",num:2}];
而且我还想知道我的 array2 是否也是具有奇怪键名的对象数组,但在结果数组中我想要一个好的键名,例如
let array1 = [{name:"ABC",add:"XYZ"},{name:"PQR",add:"CCC"}];
let array2=[{weirdKey:1},{weirdKey:2}];
但结果数组会像
array1=[{name:"ABC",add:"XYZ",num:1},{name:"PQR",add:"CCC",num:2}];
慕姐8265434
慕哥9229398
慕尼黑5688855
一只甜甜圈
相关分类