javascript write to local storage code example
Example 1: local storage javascript
function createItem() {
localStorage.setItem('nameOfItem', 'value');
}
createItem()
function getValue() {
return localStorage.getItem('nameOfItem');
}
console.log(getValue());
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: my local storage
function set(){
var sendJson = JSON.stringify(allwish);
localStorage.setItem("wishKay",sendJson);
}