Answers for "javascript show local storage usage"

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

Code answers related to "javascript show local storage usage"

Code answers related to "Javascript"

Browse Popular Code Answers by Language