Checking If An Array Is Empty In Javascript