On Mon, Nov 8, 2010 at 10:41 AM, Keean Schupke <ke...@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. / Jonas