I\'d like to add 2 methods to localStorage. My goal is to end up with something like this:
localStorage.setObject(key, object); localStorage.getObject(key);
This is IE. You also can't extend DOM elements. If you sometimes really-really need to call a function, you can do it via Storage.prototype.getObject.call(localStorage, 'hello').
Storage.prototype.getObject.call(localStorage, 'hello')
Also extending built-in objects is not considered as good thing.