I have been doing the following:
var store = window.localStorage;
store.setItem()
but now I see code doing this:
localStora
Supposedly, window.localStorage makes the localStorage faster to be found than just writing localStorage.
Storing a reference to it on a variable makes it even faster.
Anyway, these improvements are negligible on modern browsers. It only becomes useful if performance is being an issue.
Anyway, you get a possible idea about why it is being done like that.