title: Add a new attribute to json object
body: <p>I have a <code>JSON</code> object of the following format</p>
  
  <pre><code>[{"field1":1,"field2":"A","field3":"B"},
  {"field1":2,"field2":"B","field3":"C"},
  {......},
  {......},
  ]
  </code></pre>
  
  <p>I need to add a new attribute to each row based on some calculations.</p>
  
  <p>Expected result</p>
  
  <pre><code>[{"field1":1,"field2":"A","field3":"B","field4"="generatedVal1"},
      {"field1":2,"field2":"B","field3":"C","field4"="generatedVal2"},
      {......},
      {......},
      ]
  </code></pre>
  
  <p>How can I achieve this using <code>javascript</code>?</p>