title: Lodash Grab key from a nested property
body: <p>I've looked at a number of SO posts and gotten myself confused as to the <code>_.findKey</code> function of loDash. </p>
  
  <p>I have working code, in that it returns the correct value, but have an unwanted side-effect that I need rid of.</p>
  
  <p>Example data;</p>
  
  <pre><code>responderRooms = {
    MasterVal: {
      status: Value1,
      time: Value2,
      msg: Value3,
      responders: {
        4471230123456: {}
      }
    }
  }
  </code></pre>
  
  <p>I know what the <code>4471230123456</code> value is and am attempting to learn the <code>MasterVal</code> key.</p>
  
  <p>Typically, `_.findKey' would allow me to specify the array, path and a value to look for. For example, </p>
  
  <pre><code> console.log( _.findKey(responderRooms, 'time', 'Value2') // Returns MasterVal
  </code></pre>
  
  <p>However when the value to be matched is part of nested array, I'm trying:</p>
  
  <pre><code> var responderIndex = _.findKey(responderRooms, function(o) {
          return o.responders.tel = 4471230123456;
      });
  </code></pre>
  
  <p>Which does return the correct key, but adds a further 'tel = NewSentTo' to the ResponderVal array. Resulting in:</p>
  
  <pre><code>responderRooms = {
    MasterVal: {
      status: Value1,
      time: Value2,
      msg: Value3,
      responders: {
        4471230123456: {},
        tel: 4471230123456 // &lt;&lt; This shouldn't be here!
      }
    }
  }
  </code></pre>
  
  <p>How can I find the Masterkey value, using the key of a nested object as criteria, without adding an additional property?</p>
  
  <p><code>responders</code> is created with: </p>
  
  <pre><code> objPath = MasterVal + '.responders.' + data.tel
      _.set(responderRooms, objPath, {
              name: data.name,
              type: data.type,
              msgStatus: data.msgStatus,
              location: data.location,
              jobStatus: data.jobStatus
      }); 
  </code></pre>
  
  <p>Thanks,
  Nick</p>