var testObject = { 'one': 1, 'two': 2, 'three': 3 };
// Put the object into storage
localStorage.setItem('testObject', JSON.stringify(testObject));
// Retrieve the object from storage
var retrievedObject = localStorage.getItem('testObject');
console.log('retrievedObject: ', JSON.parse(retrievedObject));
let fruits = [
{ name: 'apple', color: 'red', number: 1 },
{ name: 'orange', color: 'orange', number: 2 }
]
localStorage.setItem("saved_fruits", JSON.parse(JSON.stringify(fruits)));
// SET
localStorage.setItem('myCat', 'Link');
// GET
let aValue = localStorage.getItem('myCat');
localStorage.getItem('data')
localStorage.setItem('token', 'token here');
localStorage.removeItem('token');
function populateStorage() {
localStorage.setItem('bgcolor', 'red');
localStorage.setItem('font', 'Helvetica');
localStorage.setItem('image', 'myCat.png');
}
localStorage.setItem('bgcolor', 'red');
function set(){
var sendJson = JSON.stringify(arrayName);
localStorage.setItem('key',sendJson)
}
localStorage.setItem("mytime", Date.now());
storage.setItem(keyName, keyValue);
localStorage