【发布时间】:2021-06-04 20:10:50
【问题描述】:
我有一个具有不同值的对象。
let arr = [{"Personal": "1000"},{"sport": "2100"},{"Industrial": "1200"},{"Commercial": "2300"},
{"Fashion": "1300"},{"Documentary": "2600"}]
我怎样才能找到它们,然后将它们放在一个对象中并为它们取一个名字,如下所示:
"photo_type": {
"Personal": "1000",
"sport": "2100",
"Industrial": "1200",
"Commercial": "2300",
"Fashion": "1300",
"Documentary": "2600"
}
我不希望它们像 0 和 1 和 2 一样。
【问题讨论】:
-
您可能想向我们展示您的尝试或分享最小的可重现示例。 stackoverflow.com/help/minimal-reproducible-example
标签: javascript arrays object foreach