Different ways of defining unassign variable in javascript
<p>I know when we want to define unassign variable in Javascript we can do:</p>

<pre><code>var p;
</code></pre>

<p>and the other:</p>

<pre><code>var p ={};
</code></pre>

<p>i want to know differences between these two ways, and if i define a variable in second way it is not null! what is the value in the variable, if we want using it in a <code>if</code> condition, for example :</p>

<pre><code>var p ={};
if(p=='what i shout put there')
  {}
</code></pre>