Move webStorage.length evaluation out the for-loop

Standard JS best practice - this way the length is only calculated once.
Would only make a difference if the loop might change that length (which shouldn't happen).