将type:[{}]里面的content转化成 下面choiceA=type[0].contentchoiceB=type[1].content .....
const type = [ { num: "A", content: "I'm A." }, { num: "B", content: "I'm B." }, { num: "C", content: "I'm C." } ] const target = { /*...*/ } type.forEach(i => target[ "choice" + i.num ] = i.content)
1.4m articles
1.4m replys
5 comments
57.0k users