title: How to use find() method on nested arrays?
body: <p>In this example you can see that find method works fine in this array:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var inventory = [
      {name: 'apples', quantity: 2},
      {name: 'bananas', quantity: 0},
      {name: 'cherries', quantity: 5}
  ];
  
  
  console.log(inventory.find(fruit =&gt; fruit.name === 'cherries')); 
  // { name: 'cherries', quantity: 5 }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Once I add one more level and trying to find item in it it just dont find it, it shows undefined:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var inventory = [
      {name: 'apples', quantity: 2},
      {name: 'bananas', quantity: 0},
      {name: 'cherries', quantity: 5, type: [
         {name: 'rainier', quantity: 3},
         {name: 'bing', quantity: 2}
       ]}
  ];
  
  
  console.log(inventory.find(fruit =&gt; fruit.name === 'bing')); 
  // undefined
  // should be: { name: 'bing', quantity: 2 }</code></pre>
  </div>
  </div>
  </p>
  
  <p>So I guess there is some other way to do this, but i dont know it and cant find nothing.</p>