There seems to be an issue with how localStorage.setItem stores object values when the object contains keys with array values.
var obj = data : { cachedat : ['1' , 2 , 3] };
localStorage.setItem('data' , JSON.stringify(obj) );
However,
var arr = JSON.parse(localStorage.getItem('data')) ;
return like arr = data " { cachedat : []};