title: Getting last appearance of a deeply nested value by specified property
body: <p>I've got this object as example:</p>
  <pre><code>const obj = {
      group: {
          data: {
              data: [
                  {
                      id: null,
                      value: 'someValue',
                      data: 'someData'
                  }
              ]
          }
      }
  };
  </code></pre>
  <p>My goal is to get a value by propery name.</p>
  <p>In this case I would like to get
  the value of the <code>data</code> propery, but the <strong>last</strong> appearance of it.</p>
  <p>Meaning the expected output is:</p>
  <pre><code>someData
  </code></pre>
  <p>However, I'm using this recursive function to retreive it:</p>
  <pre><code>const findVal = (obj, propertyToExtract) =&gt; {
    if (obj &amp;&amp; obj[propertyToExtract]) return obj[propertyToExtract];
  
    for (let key in obj) {
        if (typeof obj[key] === 'object') {
            const value = findVal(obj[key], propertyToExtract);
            if (value) return value;
        }
    }
    return false;
  };
  </code></pre>
  <p>Which gives me the <strong>first</strong> appearance of <code>data</code>, meaning:</p>
  <pre><code>data: [
      {
         value: 'someValue',
         data: 'someData'
      }
  ]
  </code></pre>
  <p>How can I get the wanted result?</p>