how to store local storage in javascript code example
Example 1: javascript store object in local storage
var person = { "name": "billy", "age": 23};
localStorage.setItem('person', JSON.stringify(person));
var retrievedPerson = JSON.parse(localStorage.getItem('person'));
Example 2: javascript get local storage
var Item = localStorage.getItem('youritem');
Example 3: how to get data from localstorage in javascript
var data = JSON.parse(localStorage.getItem("key name"));
Example 4: js local storage
myStorage = localStorage;
localStorage.setItem('myCat', 'Tom');
var cat = localStorage.getItem('myCat');
localStorage.removeItem('myCat');
localStorage.clear();