On Mon, Nov 8, 2010 at 10:41 AM, Keean Schupke <keean@fry-it.com> wrote: > Hi, > In code, if: > idbObjectStoreSync.put(key, undefined) does the same as > idbObjectStoreSync.remove(key) > then > idbObjectStoreSync.get(key) can safely return undefined for no such key > exists. > > Consider: > idbObjectStoreSync.put('mykey', undefined); // deletes the object stored > under mykey or noop. > idbObjectStoreSync.get('mykey'); // returns 'undefined' > idbObjectStoreSync.put('mykey', myobject); > idbObjectStoreSync.get('mykey'); // returns 'myobject' > idbObjectStoreSync.put('mykey', undefined); // deletes the object stored > under mykey or noop. > idbObjectStoreSync.get('mykey'); // returns 'undefined' Indeed. But I think this is more unexpected and confusing than having .get() return the same thing if the entry exists as if it contains undefined. / JonasReceived on Monday, 8 November 2010 18:48:21 GMT
This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:41 GMT