I have:
const fruit = ["Apple", "Orange", "Peer"]
const rank = ["1", "2", "3"]
If I do:
const values = [{
"fruit" : fruit,
"rank" : rank
]}
I get
values = [{
{"fruit": ["Apple", "Orange", "Peer"]},
{"rank": ["1", "2", "3"]}
}]
What should I do to get the data in the below format?
values = [
{ fruit: "Apple", rank : "1"},
{ fruit: "Orange", rank : "2"},
{ fruit: "Peer", rank : "3"},
];