将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)
2.1m questions
2.1m answers
60 comments
57.0k users