title: Append new properties to existing JSON object
body: <p>I have the following json</p>
  
  <pre><code>{"groupOp":"AND","rules":[{"field":"company","op":"cn","data":"School"}]}
  </code></pre>
  
  <p>I want to inject new properties into every item in the rules array to get something like this.</p>
  
  <pre><code>{"groupOp":"AND","rules":[{"field":"company","op":"cn","data":"School", "dataType": "Organization", "dataProperty": "name"}]}
  </code></pre>
  
  <p>The plan is to loop through the array called rules and dynamically add the correct values using the following.</p>
  
  <pre><code>var filters = $.parseJSON(postData.filters); 
  var rules = filters.rules;
  for (i = 0; i &lt; rules.length; i++) { 
    rules[i]
  }
  </code></pre>
  
  <p>I have access to rules at index "i". I tried <code>rules[0].push({dataType: "Organization"});</code> 
  please help.</p>