I don’t have an access to IE6 right now, so, I am asking here.
If I have a comparison such as:
// imagine App being declared as an obj somewhere...
if (App.errorLog === undefined) {
App.errorLog = [];
}
Would that code throw an error in IE6 if the property was never declared or defined anywhere? It seems to work fine in other browsers even in IE7. I just think that I had some problems with IE6 while a back and used typeof to solve those problems, but I am not sure.
Properties that were not set will simply return the value of
undefined. Only undeclared variables will actually raise aReferenceError, this is where you then have to usetypeof foo === 'undefined'.So yes, your code will work.