Page 1 of 1

array from localstorage object

Posted: Mon May 04, 2015 2:47 am
by She

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


array from localstorage object

Posted: Tue May 05, 2015 3:37 am
by Yurii Orishchuk

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.