In the snippet below.
Is all of local storage pulled from the disk into the variable cache?
(function(){
var publik = {},
cache = localStorage;
publik.get = function(){}; // getter
publik.set = function(){}; // setter
return publik;
})()
Yes/No and Why.
What you are storing in a variable is a pointer to the localStorage object, this object does not “contains” the disk data, it gives it to you when you ask for it.
So no, it does not pull the disk data into memory
Update:
If you want to cache the local storage you can interate it and ask for every key one by one
Here you ASK the local storage for every key and it reads it.