title: How to convert Array of Array to JSON in Angular JS?
body: <p>This is array of array data in a variable 'data'. I would like to convert array of array data to JSON using AngularJS and use in View using $scope object</p>
  
  <pre><code>$scope.data =[["Name", "Age", "Address"],
                 [ "A", "43", "CA" ],
                 [ "B", "23", "VA" ],
                 [ "C", "24", "NY" ]]
  </code></pre>
  
  <p>Function wrote to convert array of array to JSON:</p>
  
  <pre><code>$scope.jsonData = function () {
              var result = [];
              var keys = data[0];
  
              for (var i = 1; i &lt; data.length; i++) {
                  var item = {};
                  item[keys[0]] = data[i][0];
                  item[keys[1]] = data[i][1];
                  item[keys[2]] = data[i][2];
                  result.push(item);
              }
  return result
          };
  </code></pre>
  
  <p>I am not seeing JSON output, where am I doing wrong?</p>
  
  <p>Desired Output:</p>
  
  <pre><code>[
    {
      "Name": "A",
      "Age": "43",
      "Address": "CA"
    },
    {
      "Name": "B",
      "Age": "23",
      "Address": "VA"
    },
    {
      "Name": "C",
      "Age": "24",
      "Address": "NY"
    }
  ]
  </code></pre>