I have named arrays that I want store in local storage.
For example:
testla=[];
testla['aaaa']='a';
However, when I try:
console.log(JSON.stringify(testla));
This outputs:
[]
And even more weird, when using:
testla=[];
testla[10]='a';
I get strange results like this:
[null,null,null,null,null,null,null,null,null,null,"a"]
According to docs, localstorage can only store strings, therefore stringifying makes sense to me, but apparently it doesn't work, so there must be other way of doing this.