In my code I am doing a lot of the following:
var store = window.localStorage;
var accountID = store.getItem('AccountID'),
pageID = store.getItem('PageID'),
referenceID = store.getItem('ReferenceID'),
topicID = store.getItem('TopicID');
Is there a way I could do this more efficiently. For example could I create an object in Javascript and store / get the whole object at once?
Well, if you try it, you’ll find that you can’t. Whatever you store will be set as its
toStringvalue.One possibility depending on what data you’re storing would be to stringify it as JSON data, then parse it when needed.
Of course this will limit you to the types of data that are JSON compatible.