Answers for "how to get all data from Local storage"

1

get all local storage

const items = { ...localStorage };
Posted by: Guest on June-15-2021
4

javascript get local storage

var Item = localStorage.getItem('youritem');
Posted by: Guest on February-22-2020
0

view all local storage js

var i;

console.log("local storage");
for (i = 0; i < localStorage.length; i++)   {
    console.log(localStorage.key(i) + "=[" + localStorage.getItem(localStorage.key(i)) + "]");
}

console.log("session storage");
for (i = 0; i < sessionStorage.length; i++) {
    console.log(sessionStorage.key(i) + "=[" + sessionStorage.getItem(sessionStorage.key(i)) + "]");
}
Posted by: Guest on June-24-2021
0

how to setItem and getItem in javascript in localStorage

function set(){
    var sendJSON = JSON.stringify(allMovie);
    localStorage.setItem('allMovie',sendJSON)
}

function get(){
    var getJSON = localStorage.getItem('allMovie');
    if (getJSON){
        allMovie = JSON.parse(getJSON)
    }

}
Posted by: Guest on August-10-2020

Code answers related to "how to get all data from Local storage"

Code answers related to "Javascript"

Browse Popular Code Answers by Language