I want to make a function that add an item to my localStorage object. E.g.:
alert(localStorage.getItem(\'names\').addItem(\'Bill\').getItem(\'names\'));
This is impossible.
If getItem('names') returns Bill, you can't call addItem on it. It would be possible to add addItem and getItem methods to every item in the storage, but it would be a horrible idea.
getItem('names')
Bill
addItem
getItem