She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

array from localstorage object

Hi Team,

How can i get the specific object from localStorage object?:

Image

i used the following code:
code
var obj = localStorage.getItem('TardyColor');
var x = JSON.parse(obj);
console.log(x);
/code

below is i've tested code to display the specific object but this is not working i dont know why.
code
var obj = localStorage.getItem('TardyColor');
var x = JSON.parse(obj);
console.log(x.getDate);
/code

Thank you,
She

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

array from localstorage object

Hi She,

Please try this code:

pre

var obj = localStorage.getItem('TardyColor');
var x = JSON.parse(obj);

for(var i = 0; i < x&#46;length; i++){
var getDate = x&#46;getDate;
console&#46;log("getDate = " + getDate);
};

/pre

Regards.

Return to “Issues”