Is it possible to re-structure the below array
[
{"period":"2016-09-18","mp-demo-1":30},
{"period":"2016-09-18","MP7":20},
{"period":"2016-09-19","mp-demo-1":13},
{"period":"2016-09-19","MP7":33},
{"period":"2016-09-20","mp-demo-1":39},
{"period":"2016-09-20","MP7":29}
]
into
[
{"period":"2016-09-18","mp-demo-1":30,"MP7":20},
{"period":"2016-09-19","mp-demo-1":13,"MP7":33},
{"period":"2016-09-20","mp-demo-1":39,"MP7":29},
]
What I basically need is to remove duplicate entries by the key (period) and add the values containing in those objects in to a single object.
Will this be possible using underscore.js? Or is there another way of doing this using jQuery or any other library.