I have an array of data, but I want to convert it to an object
how to make data array into object like this?
[
{
date: "2018-01-31",
icp: "65.59",
slc: "65.83",
dc: "64.55"
},
{
date: "2018-02-28",
icp: "61.61",
slc: "62.31",
dc: "59.93"
},
{
...
}
]
please help me to solve this problem
2
Answers
Try once with following code:
Just use
forEach
and do someswitch
logic like this: