If i save my array in the localStorage the values saved with String keys are getting lost.
Example:
var myArray = [];
myArray["key1"] = "value1";
myArray[123] = "value2";
Everything works and the output of the following works:
myArray["key1"] => value1
myArray[123] => value2
Now if i store the array with something like:
localStorage.setItem('myStoredArray',JSON.stringify(myArray));
var myArray = JSON.parse(localStorage.getItem('myStoredArray'));
The output is missing the value assigned with a String Key:
myArray["key1"] => undefined
myArray[123] => value2
Am i doing something wrong ,should it work or is there another way to save it that i have my values assigned with String keys?
Thanks in advance!
parseit before reading it..