Skip to content

Instantly share code, notes, and snippets.

@shaneriley
Created September 28, 2012 09:56
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shaneriley/3798945 to your computer and use it in GitHub Desktop.
Storage prototype object getter/setter methods
Storage.prototype.setObject = function(key, value) {
this.setItem(key, JSON.stringify(value));
};
Storage.prototype.getObject = function(key) {
return JSON.parse(this.getItem(key));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment