title: Check if array has the key value pairs of the other array
body: <p>I have two sets of arrays:</p>
  
  <pre><code>var a = [1, 2, {a: 1, b:2}, 3];
  var b = [1, {a: 1, b: 2}, 3};
  </code></pre>
  
  <p>If array a has ALL (EXACT) the properties and values of array b (including objects) then it will increment count by 1. Otherwise, if array a has only some properties and some values doesn't match, it will just exit and do nothing.</p>
  
  <p>As an example:</p>
  
  <pre><code>var a = [1, 2, {a: 1, b:2}, 3];
  var b = [1, {a: 1, b: 2}, 3}; 
  // return true / count++
  
  var a = [1, 2, 3, {a: 1, b: 4}];
  var b = [1, 2, {a: 1, b: 6}, 3];
  return false / no count
  </code></pre>
  
  <p>Here's my program first:</p>
  
  <pre><code>for(var i = 0; i &lt; mainArr[i]; i++){
  if(arr.includes(mainArr[i])){
        count++;
      }
  
  if(typeof(mainArr[i]) === 'object' &amp;&amp; typeof(arr[i]) === 'object'){
        for(var mainArrProp in mainArr[i]){
          for(var arrProp in arr[i]){
            if(arr[i].hasOwnProperty(mainArrProp) &amp;&amp; arr[i][arrProp] === mainArr[i][mainArrProp]){
              count++;
            }
          }
        }
      }
  }
  </code></pre>
  
  <p>Any way to fix this?</p>