title: Initialize an array of object with unknown keys in a better way using es6
body: <p>I have an object as follows:</p>
  
  <pre><code>{
      "counts": {
          "created_by_ref": {
              "00f5c303-32c0-4f5f-ac61-bf6577a8f4ed": 1,
              "0dde2de1-7951-45b1-8bf3-013f8dbfc4ae": 1
          },
          "file.hashes.MD5": {
              "qqq": 200
          },
          "ipv4_addr.value": {
              "127.0.0.1": 200,
              "192.168.1.10": 200
          },
          "network_traffic.dst_port": {
              "xxx": 200
          },
          "network_traffic.dst_ref.resolves_to_refs.value": {
              "yyy": 200
          },
          "network_traffic.dst_ref.value": {
              "rrr": 200
          }
      }
  }
  </code></pre>
  
  <p>I need to initialize all the values to 0 as follows:</p>
  
  <pre><code>{
      "counts": {
          "created_by_ref": {
              "00f5c303-32c0-4f5f-ac61-bf6577a8f4ed": 0,
              "0dde2de1-7951-45b1-8bf3-013f8dbfc4ae": 0
          },
          "file.hashes.MD5": {
              "qqq": 0
          },
          "ipv4_addr.value": {
              "127.0.0.1": 0,
              "192.168.1.10": 0
          },
          "network_traffic.dst_port": {
              "xxx": 0
          },
          "network_traffic.dst_ref.resolves_to_refs.value": {
              "yyy": 0
          },
          "network_traffic.dst_ref.value": {
              "rrr": 0
          }
      }
  }
  </code></pre>
  
  <p>and all the keys except count is unknown and dynamically changing so cannot be hard code.
  What I did is:</p>
  
  <pre><code>  for (const key in getSearchDataAllCounts) {
      if (getSearchDataAllCounts.hasOwnProperty(key)) {
        Object.keys(getSearchDataAllCounts[key]).forEach((innerkey) =&gt; {
          getSearchDataAllCounts[key][innerkey] = 0;
        });
      }
    }
  </code></pre>
  
  <p>But I really think there is a better way doing it in ES6. Is there any improvement I can make to make it more es6 compatible and also do it with one loop preferebly?</p>