title: how to get object by passing id in an array of nested objects JavaScript
body: <p>example data : </p>
  
  <pre><code>var data = [
  {a:{id: "1",name: "alex",class: "1"}},
  {a:{id: "2",name: "john",class: "2"}},
  {a:{id: "3",name: "ketty",class: "3"}}
  ]
  </code></pre>
  
  <p>if i pass id as 1 result : [{name:"john",class:"1"}].</p>
  
  <p>please help me with the above question please.</p>