将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)
548k questions
547k answers
4 comments
86.3k users