title: Making a search function filter a deep nested object item
body: <p>I'm trying to make a search function in my React application to filter out an item by checking items inside it in an array. I had ideas of using <code>.filter()</code> and <code>.includes()</code> to map out the specific items in search. However, the object pulled from the backend has the item that users will search very deeply nested.</p>
  
  <p>Here is an example of the object with the item I am trying to filter commented:</p>
  
  <pre><code>const x = [
    {
      owner: "76561198111463361",
      sold: true,
      inventory: [
        {
          name: "AK-47 | Redline", //User may look for this
          price: 1369,
        },
        {
          name: "StatTrak™ AWP | Asiimov", //User may look for this
          price: 8050,
        },
      ],
      name: "m",
      password: "e",
    },
    {
      owner: "76561198111463361",
      sold: true,
      inventory: [
        {
          name: "AK-47 | Redline", //User may look for this
          price: 1369,
        },
        {
          name: "StatTrak™ AWP | Asiimov", //User may look for this
          price: 8050,
        },
      ],
      name: "m",
      password: "e",
    },
  ];
  </code></pre>
  
  <p>How could I filter these?</p>