js local storage coockie 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: 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);
}
}