title: How do I loop through a multi-level object in JS?
body: <p>How would I loop through each of the <code>value:</code> properties in the object below? My attempt in the <code>console.log</code> below obviously does not work, but that is what I was trying to accomplish. <code>console.log(key)</code> would output <code>"A1" "A2"</code>, but I can not figure out how to loop through and retrieve the names or values of deeper leveled properties.  </p>
  
  <pre><code>var object = {
      A1: {
          B1: {
              C1: "A"
          },
          B2: {
              C1: "B"
          },
          B3: {
              C1: "C"
          },
      },
      A2: {
          B4: {
              C1: "D"
          },
          B5: {
              C1: "E"
          },
          B6: {
              C1: "F"
          }
      }
  };
  
  for (var key in object) {
      console.log(object[key][key].value);
  }
  </code></pre>