Actually, I'm not sure if my title is correct.
If I have a data below like that,
const data = [
fruit: ['apple','banana', 'peer'],
vegetable: ['tomato','onion', 'leek']
]
How can I convert below that?
const filteredData = [
{fruit: 'apple', vegetable: 'tomato'},
{fruit: 'banana', vegetable: 'onion'},
{fruit: 'peer', vegetable: 'leek'},
]
datais an arrayconst data = []; data.fruit = ['apple', 'banana', 'peer']; console.log(data.fruit);)