<p dir="auto"><a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/BerkeleyTrue/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/BerkeleyTrue">@BerkeleyTrue</a> Made commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/freeCodeCamp/freeCodeCamp/commit/b4417a4f4d566a62e7d301559f58861d0be9e66d/hovercard" href="https://github.com/freeCodeCamp/freeCodeCamp/commit/b4417a4f4d566a62e7d301559f58861d0be9e66d"><tt>b4417a4</tt></a> which changes the last test in Diff Two Arrays.</p>
<p dir="auto">The instructions say:<br>
Compare two arrays and return a new array with any items not found in both of the original arrays.</p>
<p dir="auto">It doesn't say anything about duplicates.  My working assumption (and the least effort solution) is that duplicates should be retained.  This is how the test was originally written when <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/abhisekp/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/abhisekp">@abhisekp</a> submitted it.</p>
<p dir="auto">The Test:<br>
<code class="notranslate">diff([1, 2, 3, 3], [1]), [2, 3, 3]</code><br>
should return <code class="notranslate">[2, 3, 3]</code></p>
<p dir="auto">Here is my code:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function diff(arr1, arr2) {
  var output = [];

  // Check arr2 for arr1's contents
  for(i=0;i&lt;arr1.length;i++) {
    if(arr2.indexOf(arr1[i]) === -1) {
      output.push(arr1[i]); // Not found, throw it in the output
    }
  }

  // Check arr1 for arr2's contents
  for(i=0;i&lt;arr2.length;i++) {
    if(arr1.indexOf(arr2[i]) === -1) {
      output.push(arr2[i]); // Not found, throw it in the output
    }
  }

  return output;
}

diff([1, 2, 3, 3], [1]);"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">diff</span><span class="pl-kos">(</span><span class="pl-s1">arr1</span><span class="pl-kos">,</span> <span class="pl-s1">arr2</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
  <span class="pl-k">var</span> <span class="pl-s1">output</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

  <span class="pl-c">// Check arr2 for arr1's contents</span>
  <span class="pl-k">for</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-c1">=</span><span class="pl-c1">0</span><span class="pl-kos">;</span><span class="pl-s1">i</span><span class="pl-c1">&lt;</span><span class="pl-s1">arr1</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span><span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">arr2</span><span class="pl-kos">.</span><span class="pl-en">indexOf</span><span class="pl-kos">(</span><span class="pl-s1">arr1</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">-</span><span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-s1">output</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">arr1</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Not found, throw it in the output</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>

  <span class="pl-c">// Check arr1 for arr2's contents</span>
  <span class="pl-k">for</span><span class="pl-kos">(</span><span class="pl-s1">i</span><span class="pl-c1">=</span><span class="pl-c1">0</span><span class="pl-kos">;</span><span class="pl-s1">i</span><span class="pl-c1">&lt;</span><span class="pl-s1">arr2</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span><span class="pl-s1">i</span><span class="pl-c1">++</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">arr1</span><span class="pl-kos">.</span><span class="pl-en">indexOf</span><span class="pl-kos">(</span><span class="pl-s1">arr2</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">)</span> <span class="pl-c1">===</span> <span class="pl-c1">-</span><span class="pl-c1">1</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
      <span class="pl-s1">output</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">arr2</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span> <span class="pl-c">// Not found, throw it in the output</span>
    <span class="pl-kos">}</span>
  <span class="pl-kos">}</span>

  <span class="pl-k">return</span> <span class="pl-s1">output</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span>

<span class="pl-en">diff</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">,</span> <span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I made one challenge (Word Blanks) several minutes after 00:00 according the local time and found the time mismatch:</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6762673/17571680/e339af2e-5f59-11e6-8865-d3cee92ccdd1.png"><img src="https://cloud.githubusercontent.com/assets/6762673/17571680/e339af2e-5f59-11e6-8865-d3cee92ccdd1.png" alt="screen shot 2016-08-11 at 00 20 10" style="max-width: 100%;"></a><br>
<a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6762673/17571681/e33de1d4-5f59-11e6-8548-124094ab6f2d.png"><img src="https://cloud.githubusercontent.com/assets/6762673/17571681/e33de1d4-5f59-11e6-8548-124094ab6f2d.png" alt="screen shot 2016-08-11 at 00 20 27" style="max-width: 100%;"></a></p>