I am unable to retrieve localStorage data, as stored format appears different?
<p>I am a newbie to programming, and apologies in advance if this has been answered before.  I have done some searches and it doesn't look to me like this specific question has been answered.</p>

<p>Before attempting to store a large volume of data in localStorage (HTML5, Chrome, Windows), I have tried some sample data and attempted to store data.  When I do a console display before storing the variable shows all the data correctly.   I also seem to have some success because I see the sample data in the localStorage via the console.   </p>

<p>However, I am baffled that the data appears multiple times in a continuous line.  When I try to retrieve the data with a getItem, I get a null.  I am not doing anything fancy for either storing or for retrieving data.  </p>

<p>The code I use for storing and retrieving are shown below, as also the data in the localStorage as viewed by the Chrome console.</p>

<p>I have also tried JSONstringify in one of my attempts.</p>

<p>Storing:</p>

<pre><code>window.localStorage.setItem('result', zlldata); 
</code></pre>

<p>Retrieving:</p>

<pre><code>GETzlldata = window.localStorage.getItem(zlldata);
zlldata = JSON.parse(GETzlldata);
</code></pre>

<p>Data in the LS look like this:  (I tried 2 different approaches, once with 'this.zlldata' and the other time with 'result' in the setItem attempts.</p>

<pre><code>this.zlldata: "undefined"
{"zipLatLong": [
    {"zipcode":"35004","lat":"33.606379","longit":"-86.50249"},
    {"zipcode":"35005","lat":"33.592585","longit":"-86.95969"},
    {"zipcode":"35006","lat":"33.451714","longit":"-87.23957"},
    {"zipcode":"35007","lat":"33.232422","longit":"-86.80871"}
    ]
}
{"zipLatLong": [
    {"zipcode":"35004","lat":"33.606379","longit":"-86.50249"},
    {"zipcode":"35005","lat":"33.592585","longit":"-86.95969"},
    {"zipcode":"35006","lat":"33.451714","longit":"-87.23957"},
    {"zipcode":"35007","lat":"33.232422","longit":"-86.80871"}
    ]
}
</code></pre>

<p>Question I have is how do I retrieve the data. I mentioned that data looks different because of all the 'return' characters that show up.  Regardless the data should be 'retrievable'.  I have allocated enough space in localStorage for the purpose at 5 MB.  The format is the same for all records.  The purpose of this exercise is a project that I am doing for the course and this approach has other uses.  I am aware that in the real world other easier ways are available (e.g. via APIs to websites).   </p>

<p>Appreciate any help.   Just as additional info, I don;t need to retrieve all data each time, but only need to validate that the zipcode (for eg, exists)</p>

<p>Thanks again in advance and sorry for the lengthy post</p>