title: Check if multidimensional object is empty
body: <p>I have a multidimensional object. Depending on its content (empty or not empty) I want to execute different functions.<br>
  So I'm trying to check if it's empty:</p>
  
  <pre><code>arr = [
    [],
    [],
    []
  ];
  
  Object.size = function(obj) {
    var size = 0,
      key;
    for (key in obj) {
      if (obj.hasOwnProperty(key)) size++;
    }
    return size;
  };
  
  var size = Object.size(arr);
  
  if (size &gt; 0) {
    alert("NOT empty!")
  } else {
    alert("empty...")
  }
  </code></pre>
  
  <p>In my example it says <code>NOT empty!</code>, though it is empty (well, kind of. There are several empty objects).</p>
  
  <p>So how can I determine if it consists of empty objects?</p>
  
  <p><a href="https://jsfiddle.net/zn2xth1n/2/" rel="nofollow noreferrer">Here is a fiddle</a>.</p>