title: Looping through nested JSON object like tree object
body: <p>I have an object, </p>
  
  <pre><code>var cObj = {
    name: 'Object1',
    oNumbers: 3,
    leaf: [
      {
        name: 'Inner Object 1',
        oNumbers: 4,
        leaf: []
      },
      {
        name: 'Inner Object 2',
        oNumbers: 9,
        children: [
          {
            name: 'Inner Object 1 2',
            oNumbers: 2,
            leaf: []
          }
        ]
      }
    ]
  }
  </code></pre>
  
  <p>I wanted to loop through all the nodes and wanted to print 
  eg:</p>
  
  <pre><code>  Object 1
    Number 3
        Inner Object 1
        Number 4
  
        Inner Object 2
        Number 9
  
           Inner Object 1 2
           Number 2
  </code></pre>
  
  <p>I was thinking to loop through using recursive but couldn't achieve. Can someone please guide me through.</p>