How do I get the id value of localstorage

How do I get the id value of localstorage

for (var i = 0; i < localStorage.length; i++){

the console log will output 

[{"id":"500","joke":" User title : Chuck Norris can access the DB from the UI."},{"id":"464","joke":" User title : \"It works on my machine\" always holds true for Chuck Norris."},{"id":"2","joke":" User title : MacGyver can build an airplane out of gum and paper clips. Chuck Norris can kill him and take it."}]

but I want to get all the id's



How would you implement that method to my codes


map replaces your for loop. Read the documentation on how you would implement it.


Because we don’t know what do you have in the localstorage I think that you are trying to get the ‘key’ of the localstorage… But I don’t know, maybe every value in the store is an array just like your example, that way is correct you just need to use the map function.