title: Access JSON or JS property using string
body: <p>I have a JSON array like this:</p>
  
  <pre><code>_htaItems = [
      {"ID":1,
       "parentColumnSortID":"0",
       "description":"Precondition",
       "columnSortID":"1",
       "itemType":0},
      {"ID":2,
       "parentColumnSortID":"0",
       "description":"Precondition",
       "columnSortID":"1",
      "itemType":0}]
  </code></pre>
  
  <p>I want to update this by passing the ID, column name and new value to a function:</p>
  
  <pre><code>    function updateJSON(ID, columnName, newValue)
      {
          var i = 0;
          for (i = 0; i &lt; _htaItems.length; i++)
          {
              if (_htaItems[i].ID == ID)
              {
                  ?????
              }
          }
      }  
  </code></pre>
  
  <p>My question is, how do I update the value? I know I can do something like the following:</p>
  
  <pre><code> _htaItems[x].description = 'New Value'
  </code></pre>
  
  <p>But in my cause, the column name is being passed as a string.</p>