how to work with local storage code example
Example 1: local storage ha
function set(){
var sendJson = JSON.stringify(allPerfume);
localStorage.setItem("allPerfume", sendJson);
}
function get() {
var getJson = localStorage.getItem("allPerfume")
if (getJson) {
allPerfume = JSON.parse(getJson);
}
}
Example 2: js local storage
myStorage = localStorage;
localStorage.setItem('myCat', 'Tom');
var cat = localStorage.getItem('myCat');
localStorage.removeItem('myCat');
localStorage.clear();