var rawData = res.result[0];
var arr = []
for (let i in rawData ) {
let o = {};
o[i] = rawData [i];
//o.name = i;
//o.value = rawData [i];
arr.push(o)
}
console.log(arr);
js如何将对象转换为数组
最新推荐文章于 2024-07-31 11:54:16 发布
var rawData = res.result[0];
var arr = []
for (let i in rawData ) {
let o = {};
o[i] = rawData [i];
//o.name = i;
//o.value = rawData [i];
arr.push(o)
}
console.log(arr);