How to do a "soft" if condition check in Javascript
<p>Like you would do in php:</p>

<pre><code>if (@$some_var_exists)
    // do stuff
</code></pre>

<p>How would you do something like this in Javascript without getting an error?</p>

<p>Thanks</p>

<p>EDIT:
Thanks for the answers. However, the problem I'm trying to solve is how to check if a variable exists when it's deep in a object, for example:</p>

<pre><code>if (someObj.something.foo.bar)
  // This gives an error in the browser if "someObj.something.foo" is not defined.
</code></pre>
