title: How to wrap localStorage methods
body: <p>I need to wrap <code>localStorage</code>'s <code>setItem</code>, <code>getItem</code> and <code>removeItem</code> methods so I can write something like this</p>
  
  <pre><code>local.set('foo', 'bar'); // equivalent to localStorage.setItem('foo', 'bar')
  </code></pre>
  
  <p>I used to do it nice and simple</p>
  
  <pre><code>local.set = localStorage.setItem
  </code></pre>
  
  <p>before I learned that <a href="https://stackoverflow.com/questions/5140156/illegal-operation-on-wrappednative-prototype-object">Firefox doesn't like this approach</a>. So I changed my code to this</p>
  
  <pre><code>local.set = function() { return localStorage.setItem(arguments) };
  </code></pre>
  
  <p>but now I get an error <code>NS_ERROR_XPC_NOT_ENOUGH_ARGS: Not enough arguments</code>. What am I doing wrong?</p>