title: Transform JSON without property names
body: <p>I have a JSON feed for reports from a REST API that looks something like:</p>
  
  <pre><code>{
  "columns": [
    {
      "name": "DateAdded"
    },
    {
      "name": "SupportType"
    }
    ...
  ],
  "records": [
    [
      "2016-07-05",
      "Uncategorised"
    ],
    [
      "2016-07-05",
      "Uncategorised"
    ],
    ...
  ]
  }
  </code></pre>
  
  <p>The idea is to achieve a huge saving on the size of the JSON payloads for large reports by only sending the column names once, and then just arrays of values for each row.</p>
  
  <p>However most grids, especially my current candidate, the DevExpress <a href="http://js.devexpress.com/Documentation/ApiReference/UI_Widgets/dxDataGrid/?version=16_1" rel="nofollow">dxDataGrid</a>, seem to only be happy with more 'correct' JSON, i.e. with redundant property names in each row.</p>
  
  <p>Now I am looking for a very efficient way of transforming the incoming JSON to include property names. My first idea is simply to iterate each row, or value array, by index, and use that index to look up the column/property name in the columns array, and push a proper JS row object with name/value pairs to a new data array for the grid. However, I feel there may just be some more efficient way of transforming the JSON.</p>