title: Searching object in object array
body: <p>I have the following array: </p>
  
  <pre><code>const HEROES = [
  { id: 1, name: 'Captain America', squad: 'Avengers' },
  { id: 2, name: 'Iron Man', squad: 'Avengers' },
  { id: 3, name: 'Spiderman', squad: 'Avengers' },
  { id: 4, name: 'Superman', squad: 'Justice League' },
  { id: 5, name: 'Wonder Woman', squad: 'Justice League' },
  { id: 6, name: 'Aquaman', squad: 'Justice League' },
  { id: 7, name: 'Hulk', squad: 'Avengers' },
  ];
  </code></pre>
  
  <p>I'm trying to pass another object { id: 5, squad: 'Justice League' } into the array to find the matching object. </p>
  
  <p>for example: </p>
  
  <pre><code>findOne(HEROES, { id: 5, squad: 'Justice League' }) 
  </code></pre>
  
  <p>should return </p>
  
  <pre><code>{ id: 5, name: 'Wonder Woman', squad: 'Justice League' }
  </code></pre>
  
  <p>I'm not sure how to start this, any help would be appreciated.</p>