check local storage javascript 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: get localstorage

var pull=JSON.parse(localStorage.getItem('data'))
for(var i=0; i<pull.length; i++){
    new ConstrcterName(pull[i].AnyName, pull[i].AnyName, pull[i].AnyName)
}
for(var o=0; o<arrayName.length; o++){
    ArrayName[o].getRandom();
    ArrayName[o].showRow();

Example 3: javascript localstorage

var KeyName = window.localStorage.key(index);