title: How To Loop Through A Nested Object
body: <p>Hi there i have an nested object that looks like this </p>
  
  <pre><code>var dogTypes = {
  GermanShepard {color: "black and white"},
  Beagle       {color: "brown and white"},
  cheuwahwah  {color: "green and white"},
  poodle:    {color: "purple and white"},
   }
  </code></pre>
  
  <p>im trying to loop through all the properties in a nested object i know how to do that with a regular object but not a nested one so if someone could help me that would be great.</p>
  
  <pre><code> for (var key in dogTypes) {
   console.log(key + " : " + dogTypes[key])
   }
  </code></pre>
  
  <p>heres my code which prints out </p>
  
  <pre><code> GreatDane : [object Object]
     GermanSheppard : [object Object]
     Beagle : [object Object]
     BullDog : [object Object]
  </code></pre>
  
  <p>where would i incorporate the color property in the for in loop please help!! thanks</p>