title: How to update JSON array with dynamic key
body: <p>I want to update existing key with dynamic object of array how can I do that</p>
  
  
  
  <pre class="lang-js prettyprint-override"><code>var groupData = [
    {
      "Logon": 0,
      "Logon": 1
    }, {
      "Logoff": 0
    }, {
      "Special Logon": 0
    }, {
      "Other System Events": 0
    }, {
      "System Integrity": 0
    }, {
      "Other Logon/Logoff Events": 0
    }, {
      "Security State Change": 0
    }, {
      "Audit Policy Change": 0
    }, {
      "Security Group Management": 0
    }
  ];
  
  var key = logon;
  var val = 10;
  groupData[0].key = val;
  </code></pre>