Why does this not error out?
<p>I saw this in code today and I am kind shocked that it does not produce an error</p>

<pre><code>if($('.MyClass'))
{
  // do stuff here
}
</code></pre>

<p>So it is a jquery selector inside a if statement. According to firebug if the selector is not found it returns null. If it is found it returns the dom object.</p>

<p>So from what I can tell it always goes into the if statement but I am kind a more shocked that it does not error out.</p>

<p>If in C# you tried to just have an object or null in an if statement I don't think it would compile.</p>

<p>I was expecting at least an error to show up in firebug.</p>
