This code:
Is creating an array with 4 strings in it, and then storing that in local storage, I'm not sure why you would do that? It's also not clear to me how the various snippets of code you've posted on this
thread are supposed to connect together, can you post one complete example?
Here's a quick tutorial on localStorage: if you have four variables like this:
Then you can wrap them up into an object and stick them in localStorage like this:
You would then later extract the object with code like this:
Here is some code you can play with.
Of course if it's just four variables, you could just stick them into localStorage directly and save yourself the hassle of the wrapping and JSON manipulation.