[{232:'sfsfs'},{2323:'sfsdg'}]变成
2020-09-15 本文已影响0人
柒柒_ebea
let list_1 = []
let list=[{232:'sfsfs'},{2323:'sfsdg'}]
for (const i in list) {
list_1.push({
id: Object.keys(list[i])[0],
name: Object.values(list[i])[0]
})
}
let list_1 = []
let list=[{232:'sfsfs'},{2323:'sfsdg'}]
for (const i in list) {
list_1.push({
id: Object.keys(list[i])[0],
name: Object.values(list[i])[0]
})
}