title: Assigning variables to objects in JavaScript
body: <p>I am using the following method to basically create a JSON string.</p>
  
  <pre><code>var saveData = {};
  saveData.a = 2;
  saveData.c = 1;
  </code></pre>
  
  <p>However the .a and .c don't cut it for what I need to do, I need to replace these with strings. So something like..</p>
  
  <pre><code>var name = 'wibble';
  saveData.name = 2;
  </code></pre>
  
  <p>This would get accessed with </p>
  
  <pre><code>saveData.wibble
  </code></pre>
  
  <p>Does anyone know how this could be achieved?</p>