title: Filtering the Array Object by Matching SubObject values
body: <p>I have an array of objects:</p>
  
  <pre><code>sampledata = [{
      "id": 1,
      "parameter": {
          "Num_Of_Floors":"2",
          "East":"10",
          "Window_Type":"Window Type 1"
      },
      "energy": -145.9,
      "pv": 83.72
  }, {
      "id2": 2,
      "parameter": {
          "Num_Of_Floors":"2",
          "East":"10",
          "Window_Type":"Window Type 2"
      },  
      "energy": -145.9,
      "pv": 83.72
  }];
  </code></pre>
  
  <p>I want to get some of the object's attributes if that object's <code>parameter</code> value matches a given input.</p>
  
  <p>I have tried:</p>
  
  <pre><code>let x={Num_Of_Floors: "2", East: "10", Window_Type: "Window Type 1"}
  return this.sampledata.filter(data=&gt; data['parameter']===x) 
  </code></pre>
  
  <p>Based on the matching <code>parameter</code> object I want to return <code>energy</code> and <code>pv</code> attribute from the array object.
  Result:</p>
  
  <pre><code>{
   "energy": -145.9,
    "pv": 83.72
  }
  </code></pre>
  
  <p>Can anyone suggest how I can filter my data?</p>