Javascript testing whether or not a variable is set
<p>Generally, I test whether or not a variable is set with something like this: </p>

<pre><code>if (variable !== '') {

   do something...

}
</code></pre>

<p>I know there are other methods for testing variables like <code>typeof</code> but I don't see any advantage - is this an appropriate way to test whether or not a variable is set? Are there problems with it that I should be aware of ?</p>
