title: Javascript array within JSON Object
body: <p>I'm trying to achieve this structure (a JSON Object with an array inside):</p>
  
  <pre><code>var data = {
       page : 'hello',
       rows: [
            {
                column: 'two'
            }
       ] 
  }
  </code></pre>
  
  <p>But i'm failing miserable, trying various methods, this is my work in progress code:</p>
  
  <pre><code>var data = new Array();
      data['settings'] = [];
      var i = 0;
      var inputName, value;
      for (i; i &lt; inputs.length; i++){
          inputName = $(inputs[i]).attr('name');
          value = $(inputs[i]).val();
          data['settings'][inputName] = value;
      }
      data['page_id'] = page_id;
  </code></pre>
  
  <p>So i know the variable names are not the same as the desired example but you get the general gist! At the moment, its just making data an empty array. But i need to make it a JSON object with the idea to send it to a server. </p>