title: How to check isEmpty in javascript
body: <p>I want to check the <code>response.data.totalRows</code> is empty.</p>
  
  <pre><code>if (response!=undefined
     &amp;&amp; response.data!=undefined
     &amp;&amp; response.data.totalRows!=undefined) {
  
    alert(response.data.totalRows);
  }
  </code></pre>
  
  <p>Can simplify the code?</p>
  
  <p>UPDATE: it seems that there is no simple method like <code>isEmpty(response.data.totalRows)</code>.</p>