I have some values that are dynamically stored at localStorage with incremented values like this: localStorage[\"Value0\"], localStorage[\"Value1\"],....
When I try
To fix the problem of getting 01, simply convert the variable to a number:
var i = +localStorage.getItem('Counter'); // or +localStorage.Counter;
If you want an incremental key name, the following code can also be used (provided that you don't delete keys in between):
var keyname = 'Value' + localStorage.length;
localstorage.setItem(keyname, value);