1// SET
2localStorage.setItem('myCat', 'Link');
3
4// GET
5let aValue = localStorage.getItem('myCat');
1localStorage.setItem('user_name', 'Rohit'); //store a key/value
2var retrievedUsername = localStorage.getItem('user_name'); //retrieve the key
1function populateStorage() {
2 localStorage.setItem('bgcolor', 'red');
3 localStorage.setItem('font', 'Helvetica');
4 localStorage.setItem('image', 'myCat.png');
5}
1function set(){
2 var sendJson = JSON.stringify(arrayName);
3 localStorage.setItem('key',sendJson)
4}