I want to merge a single array of multiple objects dynamically with the same key. An example of the data is this:
var data = [{
ReportTime: "30 Apr 2017BDT",
Rate: "1.00000",
AvgGrowth: "0.0"
}, {
ReportTime: "30 Apr 2017BDT",
Rate: "0.01107",
AvgGrowth: "0.1"
}, {
ReportTime: "29 Apr 2017BDT",
Rate: "1.00000",
AvgGrowth: "0.0"
}, {
ReportTime: "29 Apr 2017BDT",
Rate: "0.01107",
AvgGrowth: "-0.5"
}]
I want to generate data like this
newData = [{
"30 Apr 2017BDT",
"1.00000",
"0.0",
"0.01107",
"0.1"
}, {
"29 Apr 2017BDT",
"1.00000",
"0.0",
"0.01107",
"-0.5"
}];
I need a suggestion or help how can I resolve this issue.