title: Using lodash to compare jagged arrays (items existence without order)
body: <p>I know I can do it using loops, but I'm trying to find an elegant way of doing this:</p>
  <p>I have two jagged arrays (array of arrays):</p>
  <pre><code>var array1 = [['a', 'b'], ['b', 'c']];
  var array2 = [['b', 'c'], ['a', 'b']];
  </code></pre>
  <p>I want to use <code>lodash</code> to confirm that the above two jagged arrays are the same. By 'the same' I mean that there is no item in <code>array1</code> that is not contained in <code>array2</code>. Notice that the items in jagged array are actually arrays. So I want to compare between inner arrays.</p>
  <p>In terms of checking equality between these items:</p>
  <pre><code>['a', 'b'] == ['b', 'a'] 
  </code></pre>
  <p>or</p>
  <pre><code>['a', 'b'] == ['a', 'b'] 
  </code></pre>
  <p>Both work since the letters will always be in order.</p>
  <hr />
  <p><strong>UPDATE</strong>: Original question was talking about to &quot;arrays&quot; (instead of jagged arrays) and for years many people discussed (and added answers) about comparing simple one-dimensional arrays (without noticing that the examples provided in the question were not actually similar to the simple one-dimensional arrays they were expecting).</p>