Cycle through variables?

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

Any help would be greatly appreciated.

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