Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

how to get all items in localstorage

function allStorage() {

    var values = [],
        keys = Object.keys(localStorage),
        i = keys.length;

    while ( i-- ) {
        values.push( localStorage.getItem(keys[i]) );
    }

    return values;
}
Comment

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)) + "]");
}
Comment

get all local storage

const items = { ...localStorage };
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery disable option by value 
Javascript :: get element or class 
Javascript :: jquery get text 
Javascript :: how to calculate distance between two points in javascript 
Javascript :: electron file association 
Javascript :: javascript hide address bar mobile 
Javascript :: javascript generate 3 numbers 1 - 49 
Javascript :: random image and link js 
Javascript :: how to divide equal 3 parts of an array javascript 
Javascript :: bootstrap modal disable close on click outside react bootstrap 
Javascript :: set cookie in node 
Javascript :: how to use absolute path in react 
Javascript :: sort array based on another array 
Javascript :: jquery click hold down 
Javascript :: event.target parent 
Javascript :: componentdidupdate in hooks 
Javascript :: splidejs autoscroll 
Javascript :: angular access form control value 
Javascript :: mongoose find and update prop 
Javascript :: js code stars 
Javascript :: object keys and values javascript 
Javascript :: remove undefined from javascript array map 
Javascript :: traverse an array in javascript 
Javascript :: move file from one folder to another in aws s3 nodejs 
Javascript :: javascript rtsp player 
Javascript :: javascript format number with K M 
Javascript :: discord js fetch user 
Javascript :: js matrix 
Javascript :: how to loop through date range in javascript 
Javascript :: (intermediate value).getdate is not a function 
ADD CONTENT
Topic
Content
Source link
Name
9+2 =