i have a problem.
I have that array of objects:
const iHaveThis = [{
question: "What's your name?",
answer: 'dda',
form_filled_key: 15,
},
{
question: "What's your e-mail?",
answer: '[email protected]',
form_filled_key: 15,
},
{
question: "What's your e-mail?",
answer: '[email protected]',
form_filled_key: 14,
},
{
question: "What's your name?",
answer: 'DAS',
form_filled_key: 14,
},
];
I want transform it to:
const iWillHaveThis = [{
"What's your e-mail?": '[email protected]',
"What's your name?": 'dda',
},
{
"What's your e-mail?": '[email protected]',
"What's your name?": 'DAS',
},
];
How can i make that ? Please
I already tried use reduce, map but not working.