Possible Duplicate:
HTML5 localStorage: check if item isset
I am developing an Sencha Touch 2 App using the localStorage.
I get values from the local storage like this:
var localStore = Ext.getStore('localStore');
localStore.getAt(0).data.name1 //get the value for key 'name1'
But on the first access the local storage is empty. How can I check if the key exists? When I do:
if(localStore.data.name1 === null)
I get:
Uncaught TypeError: Cannot read property 'name1' of undefined