Different behavior of javascript variables
<p>I 've inspected different behavior for undefined/undeclared variables in javascript .For example :</p>

<pre><code>var obj = {};
console.log(x);//Error
console.debug(obj.x) ;//undefined
</code></pre>

<p>My question is though c and obj.x both are not declared or defined then why I'm getting diff behavior?
Am I missing something?
How should I track which variable is already exist or not? </p>
