title: Check if an array includes an array in javascript
body: <p>The javascript <code>includes</code> function can be used to find if an element is present in an array. Take the following example:</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 arr = ['hello', 2, 4, [1, 2]];
  
  console.log( arr.includes('hello') );
  console.log( arr.includes(2) );
  
  console.log( arr.includes(3) );
  
  console.log( arr.includes([1, 2]) );</code></pre>
  </div>
  </div>
  </p>
  <p>Passing <code>'hello'</code> or <code>2</code> to the function returns <code>true</code>, as both are present in the array <code>arr</code>.</p>
  <p>Passing <code>3</code> to the function returns <code>false</code> because it is not present in the array.</p>
  <p>However, why does <code>arr.includes([1, 2])</code> return <code>false</code> as well, even though this is equal to the last element in the array? And if this method does not work, how else can I find whether my array includes the item <code>[1, 2]</code>?</p>