title: search in object tree depending on depth value
body: <p>I have an object that has random keys and values of other objects where the last depth of the tree has an id. </p>
  
  <p>I want a create a function that takes a string and depth to get the child object depending on those two values</p>
  
  <p>for example, I have the data like that:</p>
  
  <pre><code>var treeObj = {
      "random key1": {
          "random key11": {
              "random key11": {
                  "random key11": {
                      id: 25,
                      count: 364
                  },
                  "random key12": {
                      id: 52,
                      count: 644
                  },
                  "random key13": {
                      id: 5,
                      count: 664
                  },
                  "random key14": {
                      id: 5,
                      count: 624
                  }
              }
          },
          "random key2": {
              "random key21": {
                  "random key21": {
                      id: 56,
                      count: 64
                  }
              },
              "random key22": {
                  "random key221": {
                      id: 56,
                      count: 64
                  },
                  "random key222": {
                      id: 35,
                      count: 64
                  }
              },
          }
      },
      "other random key":{
          "different random key":{
              "different random key": {
                  "different random key1": {
                      id: 75,
                      count: 664
                  },
                  "different random key2": {
                      id: 57,
                      count: 624
                  },
                  "different random key3": {
                      id: 50,
                      count: 654
                  },
              },
          },
          "different random key2":{
              "different random key2": {
                  "different random key21": {
                      id: 15,
                      count: 64
                  },
              },
          }
      }
  }
  </code></pre>
  
  <p>what I want is a function like:</p>
  
  <p>get_child_obj('random key1', 0)</p>
  
  <p>should return this:</p>
  
  <pre><code>{
      "random key11": {
          "random key11": {
              "random key11": {
                  id: 25,
                  count: 364
              },
              "random key12": {
                  id: 52,
                  count: 644
              },
              "random key13": {
                  id: 5,
                  count: 664
              },
              "random key14": {
                  id: 5,
                  count: 624
              }
          }
      },
      "random key2": {
          "random key21": {
              "random key21": {
                  id: 56,
                  count: 64
              }
          },
          "random key22": {
              "random key221": {
                  id: 56,
                  count: 64
              },
              "random key222": {
                  id: 35,
                  count: 64
              }
          },
      }
  }
  </code></pre>
  
  <p>and a function like that: </p>
  
  <pre><code>get_child_obj('different random key', 2)
  </code></pre>
  
  <p>should return this:</p>
  
  <pre><code>{
      "different random key1": {
          id: 75,
          count: 664
      },
      "different random key2": {
          id: 57,
          count: 624
      },
      "different random key3": {
          id: 50,
          count: 654
      },
  }
  </code></pre>
  
  <p>and a function like that: </p>
  
  <pre><code>get_child_obj('random key12', 3)
  </code></pre>
  
  <p>should return this:</p>
  
  <pre><code>{
      id: 52,
      count: 644
  }
  </code></pre>
  
  <p>please note that for each depth the key is unique.</p>