title: Check if array is empty or null
body: <p>I would like to know how to check if an array is empty or null in jQuery. I tried <code>array.length === 0</code> but it didn't work. It did not throw any error either.</p>
  
  <p>This is the code:</p>
  
  <pre><code>var album_text = new Array();
  
  $("input[name='album_text[]']").each(function(){
    if( $(this).val() &amp;&amp;  $(this).val() != '') {
      album_text.push($(this).val());
    }
  });
  if (album_text.length === 0) {
    $('#error_message').html("Error");
  }
  
  else {
    // send data
  }
  </code></pre>