public
Created

Storage prototype object getter/setter methods

  • Download Gist
gistfile1.js
JavaScript
1 2 3 4 5 6 7
Storage.prototype.setObject = function(key, value) {
this.setItem(key, JSON.stringify(value));
};
 
Storage.prototype.getObject = function(key) {
return JSON.parse(this.getItem(key));
};

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.