title: Using string from variable as property name for JSON in Javascript?
body: <p>So I'm grabbing a JSON via AJAX, but need to re-configure it. Part of that means using a string contained in a variable as the property name of a nested object.</p>
  
  <p>But Javascript doesn't allow this. It treats variables as literal strings, instead of reading the value.</p>
  
  <p>Here's a snippet:</p>
  
  <pre><code>var pvm.exerciseList = [];
  
  $.get('folder_get.php', function(data){
      var theList = $.parseJSON(data);
      $.each(theList, function(parentFolder, files) {
          var fileList = [];
          $.each(files, function(url, name) {
              thisGuy.push({fileURL: url, fileName: name});
          });
          pvm.exerciseList.push({parentFolder: fileList});
      });
  });
  </code></pre>
  
  <p>Is there anyway around this? I need to extract the string contained in "parentFolder." Right now, JS is just interpreting it literally.</p>