Recently, I've come across some odd behavior in Chrome following its latest update. Whenever I try to determine if a variable is defined, it ends up triggering an uncaught error like the one shown below:
if(x) { alert('x is defined.'); }
This particular line throws the following error message:
ReferenceError: x is not defined
Although I know how to manage this issue, based on my past experiences, I was expecting it to return undefined instead of throwing an exception in my application. Can someone shed some light on why this is happening? What should ideally be done is checking whether x is a property of the window object or not. Thanks in advance.