1//Set item
2localStorage.setItem('myCat', 'Tom');
3//Get item
4var cat = localStorage.getItem("myCat");
5//Remove item
6localStorage.removeItem("lastname");
7//Remove all items
8localStorage.clear();
1localStorage.setItem('myCat', 'Tom');
2
3var cat = localStorage.getItem('myCat');
4
5localStorage.removeItem('myCat');
6
7// Clear all items
8localStorage.clear();
9