title: localStorage - use getItem/setItem functions or access object directly?
body: <p>Are there some benefits of using the methods defined on the localStorage object  versus accessing the object properties directly? For example, instead of:</p>
  
  <pre><code>var x = localStorage.getItem(key);
  localStorage.setItem(key, data);
  </code></pre>
  
  <p>I have been doing this:</p>
  
  <pre><code>var x = localStorage[key];
  localStorage[key] = data;
  </code></pre>
  
  <p>Is there anything wrong with this?</p>