1Looking at the Apple, Mozilla and Mozilla again documentation, the functionality seems to be limited to handle only string key/value pairs.
2
3A workaround can be to stringify your object before storing it, and later parse it when you retrieve it:
4
5var testObject = { 'one': 1, 'two': 2, 'three': 3 };
6
7// Put the object into storage
8localStorage.setItem('testObject', JSON.stringify(testObject));
9
10// Retrieve the object from storage
11var retrievedObject = localStorage.getItem('testObject');
12
13console.log('retrievedObject: ', JSON.parse(retrievedObject));