I am new at Javascript, and I am having problems with a list of dictionaries. I have an object such as this one:
0:{Year: "2007", expenditure: "314,448.7", category: "Exports"}
1:{Year: "2008", expenditure: "320,805.2", category: "Exports"}
2:{Year: "2007", expenditure: "314,448.7", category: "Imports"}
3:{Year: "2008", expenditure: "320,805.2", category: "Imports"}
and I would like to turn it into a new one with the values Exports and Imports as two different columns, with its correspondent expenditure below. Something like this:
0:{Year: "2007", Exports: "314,448.7"}
1:{Year: "2008", Exports: "320,805.2"}
2:{Year: "2007", Imports: "314,448.7"}
3:{Year: "2008", Imports: "320,805.2"}
Does anyone know how to do this? Thank you in advance.