Modifying a JSON object by creating a New Field using existing Elements
<p>I have a javascript object that goes like this:</p>

<pre><code>var obj = {"data":
 [
  {"name":"Alan","height":1.71,"weight":66},
  {"name":"Ben","height":1.82,"weight":90},
  {"name":"Chris","height":1.63,"weight":71}
 ]
 ,"school":"Dover Secondary"
}
</code></pre>

<p>How do I create a new field called BMI using weight/(height)^2 such that the new object becomes:</p>

<pre><code>var new_obj = {"data":
 [
  {"name":"Alan","height":1.71,"weight":66,"BMI":22.6},
  {"name":"Ben","height":1.82,"weight":90,"BMI":27.2},
  {"name":"Chris","height":1.63,"weight":71,"BMI":26.7}
 ]
 ,"school":"Dover Secondary"
}
</code></pre>
