title: jQuery detect if .find(' ').text() is defined or not
body: <p>I have such a code</p>
  
  <pre><code>if ($('#bar #username').text()!=$('.widget-' + widget.id).find('.user').text())
  {
  //do something
  }
  </code></pre>
  
  <p>Unfortunately, it doesn't go through if <code>$('.widget-' + widget.id).find('.user').text()</code> does not exist/ underfined. </p>
  
  <p>How to check if it is defined?</p>
  
  <p>I've tried <code>if (typeof $('.widget-' + widget.id).find('.user') === "undefined")</code> to check whether it is defined or not, but it doesn't help because</p>
  
  <p><code>alert (typeof $('.widget-' + widget.id).find('.user'))</code> shows <code>Object</code>,</p>
  
  <p><code>alert (typeof $('.widget-' + widget.id).find('.user').text())</code> shows <code>String</code>.</p>