title: chrome.storage.local.set using a variable key name
body: <p>In a Google Chrome Extension, I want to use <a href="http://code.google.com/chrome/extensions/storage.html#property-local" rel="noreferrer"><code>chrome.storage.local</code></a> (as opposed to localStorage) because:</p>
  
  <ol>
  <li>With key-value pairs, the value can be any object (as opposed to string only)</li>
  <li>Changes to the data model using setter <code>storage.set</code> can trigger an event listener</li>
  </ol>
  
  <p>Using <code>storage.set</code>, how can I have a variable key name? </p>
  
  <p>Note: If I don't use the setter, I can do <code>storage[v1]</code>, but changes to the object won't trigger the event listener.</p>
  
  <pre><code>var storage = chrome.storage.local;
  var v1 = 'k1';
  
  storage.set({v1:'s1'});
  
  storage.get(v1,function(result){
      console.log(v1,result);
      //console output = k1 {}
  });
  storage.get('v1',function(result){
      console.log(result);
      //console output = {v1:'s1'}
  });
  </code></pre>