I'm trying to reset my values after having left a this program. Initially the variables were set before departing using setItem. I can read each variable and reset it by using
vartbl[a1,a2,a3,a4,a5.....a50]
itm = localStorage.getItem("a1");
a1 = JSON.parse(itm);
itm = localStorage.getItem("a2");
a2 = JSON.parse(itm);**
What I would like is loop to handle this such as
for ( a = 0; a < vartbl.length; a++ ) {
vartbl[a] = JSON.parse(localStorage.getItem(vartbl[a]))
}
Presently all this does is just put the value vartblp[a] into the indexed position thereby renaming the variable in the array. How can this be done correctly?
Thanks