title: searching a nested javascript object, getting an array of ancestors
body: <p>I have a nested array like this:</p>
  
  <pre><code>array = [
      {
          "id": "67",
          "sub": [
              {
                  "id": "663",
              },
              {
                  "id": "435",
              }
          ]
      },
      {
          "id": "546",
          "sub": [
              {
                  "id": "23",
                  "sub": [
                   {
                       "id": "4",
                   }
               ]
              },
              {
                  "id": "71"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>I need to find 1 nested object by its id and get all its parents, producing an array of ids.</p>
  
  <pre><code>find.array("71")
  =&gt; ["546", "71"]
  
  find.array("4")
  =&gt; ["546", "23", "4"]
  </code></pre>
  
  <p>What's the cleanest way to do this? Thanks.</p>