I'm trying to do an exercise and I need to convert this an array in another specific array, but unfortunately, I couldn't.
I need to convert this array:
let data = [
[
"2020-01-28",
100
],
[
"2020-01-27",
80
],
[
"2020-01-24",
70
],
[
"2020-01-23",
60
]
]
to this array:
let dataTwo = [
{
date: "2020-01-28",
price: 100
}, {
date: "2020-01-27",
price: 80
}, {
date: "2020-01-24",
price: 70
}, {
date: "2020-01-23",
price: 60
}
];