title: Access / process each (nested) objects, arrays or JSON
body: <p>I have looked for a couple of days for an answer and the closest to what i need is in a question already answered "Access / process (nested) objects, arrays or JSON" but the problem i'm having is that this answer will only return one nested object even though there may be two or three with the same key. </p>
  
  <p>I am currently working on a SharePoint Project where i need to retrieve the number of "SOPs" for a specific position, im making an jquery ajax call to the list where the data is being pulled from and the data is returned similar to this example, i need to be able to return each data(key):value but everything i've tried only returns the last key please help.</p>
  
  <pre><code>var root = {
  leftChild: {
      leftChild: {
          leftChild: null,
          rightChild: null,
          data: 42
      },
          leftChild: {
      leftChild: {
          leftChild: null,
          rightChild: null,
          data: 142
      },           leftChild: {
      leftChild: {
          leftChild: null,
          rightChild: null,
          data: 242
      };
  
  alert( root.rightChild.leftChild['data']);`
  </code></pre>