1function get(){
2 var getJson = localStorage.getItem('key')
3 if(getJson){
4 arrayName = JSON.parse(getJson)
5 }
6}
1// localStorage--> userName: 'jon'
2var userName = localStorage.getItem('userName');
3// userName --> jon
1var pull=JSON.parse(localStorage.getItem('data'))
2for(var i=0; i<pull.length; i++){
3 new arrayName(pull[i].AnyName, pull[i].AnyName, pull[i].AnyName)
1var pull=JSON.parse(localStorage.getItem('data'))
2for(var i=0; i<pull.length; i++){
3 new ConstrcterName(pull[i].AnyName, pull[i].AnyName, pull[i].AnyName)
4}
5for(var o=0; o<arrayName.length; o++){
6 ArrayName[o].getRandom();
7 ArrayName[o].showRow();
1//The following snippet accesses the current domain's local Storage object
2//and adds a data item to it using Storage.setItem().
3localStorage.setItem('myCat', 'Tom');
4
5//The syntax for reading the localStorage item is as follows:
6const cat = localStorage.getItem('myCat');
7
8//The syntax for removing the localStorage item is as follows:
9localStorage.removeItem('myCat');
10
11//The syntax for removing all the localStorage items is as follows:
12localStorage.clear();