title: JavaScript: Dynamically add new value to update JSON/ object
body: <p>I have dynamically created object(predefined) and set value to 0 for all months(actually 12 months I have shown only 3 months) for all years(2 years, 2015 and 2014). So my data grid will look all months with 0 value.  see below code</p>
  
  <pre><code> var arrayObj = [
                 {"year" : 2015, "month" : "JAN", "value" : 0},
                 {"year" : 2015, "month" : "FEB", "value" : 0},
                 {"year" : 2015, "month" : "MAR", "value" : 0},
                 {"year" : 2014, "month" : "JAN", "value" : 0},
                 {"year" : 2014, "month" : "FEB", "value" : 0},
                 {"year" : 2014, "month" : "MAR", "value" : 0}
               ];
  </code></pre>
  
  <p>Periodically, I will keep getting value of single month sometime in later in object format after form submit.</p>
  
  <pre><code>   eq. {"year" : 2015, "month" : "FEB", "value" : 2.33}
  </code></pre>
  
  <p>So my original object should also change accordingly, with javascript code. like below.. </p>
  
  <pre><code>  var arrayObj = [
                 {"year" : 2015, "month" : "JAN", "value" : 0},
                 {"year" : 2015, "month" : "FEB", "value" : 2.33},
                 {"year" : 2015, "month" : "MAR", "value" : 0},
                 {"year" : 2014, "month" : "JAN", "value" : 0},
                 {"year" : 2014, "month" : "FEB", "value" : 0},
                 {"year" : 2014, "month" : "MAR", "value" : 0}
               ];
  </code></pre>