sprinkles
sprinkles copied to clipboard
Add $pushItem(), $getItems(), & $getObject() to Storage.prototype
pushItem(k, v) {
var a = getItems(k);
a.push(v);
localStorage.setItem(JSON.stringify(a));
}
getItems(k) {
var a = getObject(k);
if (a == null) a = [];
return a;
}
getObject(k) {
return JSON.parse(localStorage.getItem(k));
}