1
我有这样的数据结构:需要的功能帮助处理这种数据结构
let questions=[{
question: "What is your name?",
responses: [{
userId: 1,
answer: "Geof"
}, {
userId: 5,
answer: "Pete"
}]
}, {
question: "Where are you from?",
responses: [{
userId: 3,
answer: "Earth"
}, {
userId: 5,
answer: "Mars"
}]
},.......]
我想传播这个对象:
[{ userId: 1, "What is your name?": "geoff", "Where are you from?":"", "another question":....},
{ userId: 2, "What is your name?": "", "Where are you from?":"".......}
因为我无法预测,我得到了什么问题,我我正在寻找一种以这种方式传播它的动态功能。 lodash的解决方案非常受欢迎。