title: Check if certain Javascript object key has exact nested values and then update specific nested value
body: <p>I have a Javascript object that can have either none, one, or multiple keys. Then each key has a nested value.</p>
  <p>Example</p>
  <pre><code>cart = {
      &quot;98eb9514-f403-4d08-b5f7-dd6a5ec013cb&quot;: {
          &quot;quantity&quot;: 1,
          &quot;FirstName&quot;: &quot;John&quot;,
          &quot;LastName&quot;: &quot;Lewis&quot;
      },
      &quot;92ef2918-6bc2-4f3b-b9b3-acf6ebe74b1f&quot;: {
          &quot;quantity&quot;: 1,
          &quot;FirstName&quot;: &quot;Matthew&quot;,
          &quot;LastName&quot;: &quot;Smith&quot;
      }
  }
  </code></pre>
  <p>I need to check if a key has an exact nested value. If it does, then I need to add 1 to the quantity for that exact key with that exact nested value.</p>
  <p>I am able to check if an exact key with that exact nested value exist by doing:</p>
  <pre><code>if (cart.hasOwnProperty(productId) &amp;&amp;
      cart[productId][&quot;quantity&quot;] &gt;= 1 &amp;&amp;
      cart[productId][&quot;FirstName&quot;] == FirstName &amp;&amp;
      cart[productId][&quot;LastName&quot;] == LastName) {
      console.log('add one to qty somehow...')
  }
  </code></pre>
  <p>However, this seems very inefficient and then I can't even figure out a way to add one to the quantity for just that exact key with that exact nested value.</p>
  <p>If it is not clear, my question comes down to this:
  How do I check if a key with an exact nested value exist, and if it does, how do I add 1 to the quantity for that same exact key/nested value.</p>
  <p>Been working on this for a day and half. Any help is much appreciated.</p>