Cycle through variables?

Hello…
I wan to try creating a loop to cycle through variables. My variables are named something like: localStorage.item01, localStorage.item02, localStorage.item03, etc.

Is there a way that I can loop through a bunch of them using a for/next loop?

Something like:

For i = 1 to 50
localStorage.item & i = NewValue
Next

Any help would be greatly appreciated.
Thanks!

Why not store them in an array?

I realise this is eons ago but for future viewers…

For i = 1 to 50
  localStorage["item" & i] = NewValue
Next