title: Typescript: How can I create a function to compare these two nested arrays?
body: <p>I am trying to compare these two nested arrays to ensure if they are the same but I couldn't figure it out, I tried to start but couldn't finish.</p>
  <p>I need to make sure they have both the same <code>food_names</code> and the same ingredients in the <code>selected_ingredients</code> array.</p>
  <p>Any help would be appreciated.</p>
  <pre><code>interface DataInterface {
      food_name: string,
      selected_ingredients: Array&lt;string&gt;
  }
  
  const orderFood: Array&lt;DataInterface&gt; = [
      {selected_ingredients: [&quot;Tomatoes&quot;, &quot;Lettuce&quot;, &quot;Cheese&quot;], food_name: &quot;Single Burger&quot;},
      {selected_ingredients: [], food_name: &quot;Fountain Drink&quot;}
  ];
  
  const orderFood2: Array&lt;DataInterface&gt; = [
      {food_name: &quot;Single Burger&quot;, selected_ingredients: [&quot;Tomatoes&quot;, &quot;Lettuce&quot;, &quot;Cheese&quot;]},
      {food_name: &quot;Fountain Drink&quot;, selected_ingredients: []}
  ]
  
  function isSame() {
      for(let i = 0; i &lt; orderFood.length; i++) {
          
      }
      return false;
  }
  </code></pre>