local storage documentation code example

Example 1: local storage javascript

localStorage.setItem('user_name', 'Rohit'); //store a key/value
var retrievedUsername = localStorage.getItem('user_name'); //retrieve the key

Example 2: localstorage

localStorage.setItem('name', 'Bob') // make/set a key/value
var username = localStorage.getItem('name') // get the key
console.log(username) // log the key
// This data will be saved even after you close the page

Example 3: my local storage

/* function for setIetm to local storage */

function set(){
    var sendJson = JSON.stringify(allwish);
    localStorage.setItem("wishKay",sendJson);
}