title: Object.isEmpty vs .isEmpty() vs _.isEmpty(Object) javascript, lodash, underscore
body: <pre><code>var foo = { bar: ''};
  </code></pre>
  
  <p>Often I have seen code like this:</p>
  
  <pre><code>    if(foo.bar.isEmpty()){ //this line most of the time breaks
          // do something
      }
  
  
      foo.bar.isEmpty() or foo.bar.isEmpty 
  </code></pre>
  
  <p>As far as I know, this is not native JavaScript/jQuery. Even if Lodash and Underscore are included in the project this doesn't seem to work.</p>
  
  <p>There are implementations of <code>isEmpty()</code> in Lodash and Underscore
  but the only way to use them is <code>_.isEmpty(foo.bar)</code></p>
  
  <p>Why can't I use them as <code>foo.bar.isEmpty()?</code></p>
  
  <p>What is the correct way to check for empty array, object or string? </p>