title: How can I detect if a selector returns null?
body: <p>What is the best way to detect if a jQuery-selector returns an empty object.
  If you do:</p>
  
  <pre><code>alert($('#notAnElement'));
  </code></pre>
  
  <p>you get [object Object], so the way I do it now is:</p>
  
  <pre><code>alert($('#notAnElement').get(0));
  </code></pre>
  
  <p>which will write "undefined", and so you can do a check for that. But it seems very bad. What other way is there?</p>