javascript localStorage.getItem code example
Example 1: get localstorage
function get(){
var getJson = localStorage.getItem('key')
if(getJson){
arrayName = JSON.parse(getJson)
}
}
Example 2: getitem localstorage
// localStorage--> userName: 'jon'
var userName = localStorage.getItem('userName');
// userName --> jon
Example 3: get localstorage value
localStorage.getItem('bgcolor');