Recommended way to spot undefined variable which have been declared
<p>For detect undefined variable which have been declared in javascript there at least two different ways.</p>

<pre><code>var bar; // declared variable

if (typeof bar !== "undefined") {
     // make something with bar
}

if (bar) {
     // make something with bar
}
</code></pre>

<p>My Questions: </p>

<p>1) Are the two ways equal in all the aspects?</p>

<p>2) If not what is the best?</p>
