score:2

Accepted answer

Use map

arr.map( s => ({ date : s[0], gdp : s[1] }) );

Demo

var arr = [
  [
    "1947-01-01",
    243.1
  ],
  [
    "1947-04-01",
    246.3
  ],
  [
    "1947-07-01",
    250.1
  ]
];
var output = arr.map(s => ({
  date: s[0],
  gdp: s[1]
}));
console.log(output);

score:0

You can use map to achieve that

var data = [
    [
      "1947-01-01",
      243.1
    ],
    [
      "1947-04-01",
      246.3
    ],
    [
      "1947-07-01",
      250.1
    ]
 ];
 
 var r = data.map(o=> ({date: o[0], GDP: o[1]}));
 
 console.log(r)


Related Query

More Query from same tag