【发布时间】:2019-05-27 05:36:17
【问题描述】:
我正在开发一个 reactjs 网络应用程序,我有一个类似
的数组let arr = ["name","message", etc...];
我想将它转换为对象,但看起来像
let desired = { name:'', message:'' };
我尝试了一些方法,但都没有奏效。
【问题讨论】:
-
I tried few things but none worked?你能展示你到目前为止尝试过的代码吗? -
reactjs 不应在此处标记,因为考虑的问题与 reactjs 无关。
标签: javascript arrays json object ecmascript-6