title: How to check if object is empty in javascript for all levels in object
body: <p>I wanted to find out if my object is empty or not for all its nested objects and key-value pairs.</p>
  
  <p>for e.g.,</p>
  
  <pre><code>const x = {
    a:"",
    b:[],
    c:{
      x:[]
    },
    d:{
      x:{
        y:{
          z:""
        }
      }
    }
  };
  </code></pre>
  
  <p>this should be an empty object and if any of this contains single value then it should be non empty.</p>