title: Get the values from object wrapped in another object based on the key?
body: <p>I am trying to find the Javascript values of an object wrapped in another object based on the <code>Object Key</code> using the ES6 way or single-line approach without using the loop.</p>
  <p>I have the <code>data</code> object something like this:</p>
  <pre><code>data = {
     &quot;1&quot;:{
        &quot;id&quot;:1,
        &quot;name&quot;:&quot;Identifiers&quot;,
        &quot;data&quot;:{
           &quot;ID&quot;:1,
           &quot;nodeId&quot;:1,
           &quot;eventType&quot;:&quot;Identifiers&quot;
        },
        &quot;2&quot;:{
           &quot;id&quot;:2,
           &quot;name&quot;:&quot;Events&quot;,
           &quot;data&quot;:{
              &quot;ID&quot;:2,
              &quot;nodeId&quot;:1,
              &quot;eventType&quot;:&quot;ObjectEvent&quot;
           }
        }
     }
  }
  </code></pre>
  <p>and I have a <code>connector</code> something like this:</p>
  <pre><code>{
     &quot;ID&quot;:1,
     &quot;name&quot;:&quot;connector1&quot;,
     &quot;source&quot;:&quot;1&quot;,
     &quot;target&quot;:&quot;2&quot;
  }
  </code></pre>
  <p>I want to find the information from <code>data</code> based on the <code>connector.source</code></p>
  <p>I want to pass the <code>connector.source</code> and get the corresponding values from it, something like this:</p>
  <pre><code>&quot;id&quot;:1,
  &quot;name&quot;:&quot;Identifiers&quot;,
  &quot;data&quot;:{
          &quot;ID&quot;:1,
           &quot;nodeId&quot;:1,
           &quot;eventType&quot;:&quot;Identifiers&quot;
        }
  </code></pre>
  <p>I am aware that I can use the <code>for loop</code> and do that but I am trying to find a ES6 way or using the single line code.</p>