title: Cannot convert undefined or null to object when iterating through valid JSON
body: <p>I have valid JSON with this structure</p>
  
  <pre><code>const myJSONExample = {
    "SubItems": [
      {
        "SubItems": [
          {
            "ItemNo": "000001"
          }
        ],
        "ItemNo": null,
        "Number": null,
        "price": 114.46
  
      },
      {
        "SubItems": [
          {
            "Group": "0.4.004"
          }
        ],
        "type": null
      },
      {
        "SubItems": [
          {
            "ItemNo": "000005"
          },
          {
            "Quantity": 2
          }
        ],
        "Material": "Steel"
      },
      {
        "Description": null
      }
    ]
  }
  </code></pre>
  
  <p>and just simply trying to format all number types in it, using recursive iteration.</p>
  
  <pre><code>const iterate = (obj) =&gt; {
      Object.keys(obj).forEach(key =&gt; {
  
      if(typeof(item[key]) == "number"){
                              item[key] = new Intl.NumberFormat("de-DE").format(item[key]) //format number for german lang.
                          }
  
      if (typeof obj[key] === 'object') {
              iterate(obj[key])
          }
      })
  }
  
  iterate(myJSONExample);
  </code></pre>
  
  <p>I used this functions on other JSONs, and been trying to understand for some time, why this throws <code>TypeError: Cannot convert undefined or null to object</code></p>