<p dir="auto">In the description there is a term called arity that is labeled as obsolete at <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/arity" rel="nofollow">MDN</a>. If the term is obsolete and deprecated wouldn't it be better to take it off?</p>
<p dir="auto">Furthermore in the tests you have the methods duplicated, whereas it should be like this:</p>
<ul dir="auto">
<li>expect(bob.getFirstName()).to.eql('Bob');</li>
<li>expect(bob.getLastName()).to.eql('Ross');</li>
<li>expect(bob.getFullName()).to.eql('Bob Ross');</li>
<li>expect(bob.getFirstName()).to.eql('Happy'); -&gt; should be bob.<strong>set</strong>FirstName()).to.eql('Happy');</li>
<li>expect(bob.getLastName()).to.eql('Trees'); -&gt; should be bob.<strong>set</strong>LastName()).to.eql('Happy');</li>
<li>expect(bob.getFullName()).to.eql('George Carlin'); -&gt; should be bob.<strong>set</strong>FullName()).to.eql('Happy');</li>
</ul>
<p dir="auto">Thanks!! ;)</p>
<p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/diff-two-arrays#?solution=function%20diff%28arr1%2C%20arr2%29%20%7B%0A%20%20var%20newArr%20%3D%20%5B%5D%3B%0A%0A%20%20newArr%20%3D%20arr1.concat%28arr2%29%3B%0A%20%20console.log%28%22arr%20total%20is%3A%20%22%2CnewArr%29%3B%0A%20%20%0A%20%0A%20%20%2F%2Fcount%20occurence%20of%20item%20in%20array%0A%20%20%2F%2Freturn%20number%20of%20occurrence%20%3E%200%0A%20%20var%20count%20%3D%20function%28item%2C%20array%29%7B%0A%20%20%20%20var%20count%20%3D%200%3B%0A%20%20%20%20var%20i%3D0%3B%0A%20%20%20%20for%20%28i%20%3B%20i%3Carray.length%3B%20i%2B%2B%29%7B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%20if%20%28array%5Bi%5D%20%3D%3D%20item%29%7B%0A%20%20%20%20%20%20%20%20count%2B%2B%3B%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20console.log%28%22This%20item%3A%20%22%2Bitem%2B%22%20appears%3A%20%22%2B%20count%2B%22%20times!%22%29%3B%0A%20%20%20%20return%20count%3B%0A%20%20%7D%3B%0A%20%20%0A%20arr%20%3D%20%5B%5D%3B%0A%20%0A%20var%20%20y%3D0%3B%0A%20%20var%20restOfArr%20%3D%20newArr.slice%280%29%3B%0A%20%20%0A%20%20for%20%28y%3B%20y%3CnewArr.length%3B%20%20y%2B%2B%29%7B%0A%20%20%20%20%20if%20%28restOfArr.length%20%3D%3D%200%29%7B%0A%20%20%20%20%20console.log%28%22EMPTY.%20RES%20IS%3A%20%22%2C%20arr%29%3B%0A%20%20%20%20%20return%20arr%3B%0A%20%20%20%7D%0A%20%20%20%20%2F%2Fconsole.log%28%22index%20is%3A%20%22%2C%20y%29%3B%0A%20%20%20%20var%20item%20%3D%20restOfArr%5B0%5D%3B%0A%20%20%20%20console.log%28%22item%20is%3A%20%22%2C%20item%29%3B%0A%20%20%20%20restOfArr%20%3D%20restOfArr.slice%281%29%3B%0A%20%20%20%0A%20%20%20%20var%20counter%20%3D%20count%28item%2C%20restOfArr%29%3B%0A%20%20%20%20%0A%20%20%20%0A%20%20%20%20if%20%28counter%20%3D%3D%200%29%7B%0A%20%20%20%20%20%20arr.push%28item%29%3B%0A%20%20%20%20%20%20restOfArr%20%3D%20restOfArr.filter%28function%28el%29%7B%0A%20%20%20%20%20%20%20%20return%20el%20!%3D%3D%20item%3B%0A%20%20%20%20%20%20%0A%20%20%20%20%20%2F%2F%20console.log%28%22after%20delete%20item%20restOfArr%20is%3A%20%22%2C%20restOfArr%29%3B%0A%20%20%20%20%7D%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20if%20%28counter%20%3E%200%29%7B%0A%20%20%20%20%20%20%2F%2Fce%20ne%20sono%202%20non%20addo%0A%20%20%20%20%20%20restOfArr%20%3D%20restOfArr.filter%28function%28el%29%7B%0A%20%20%20%20%20%20%20%20return%20el%20!%3D%3D%20item%3B%0A%20%0A%20%20%20%20%7D%29%3B%0A%20%20%20%20%7D%0A%20%20%20%20console.log%28%22rest%20of%20arr%3A%20%22%2C%20restOfArr%29%3B%0A%0A%20%20%20%2F%2F%20console.log%28%22FOR%3A%20arr%20is%3A%20%22%2Barr%2B%22%20newArr%20is%3A%20%22%2BnewArr%29%3B%0A%20%20%20%0A%20%20%7D%0A%20%20%0A%0A%20%20return%20arr%3B%0A%7D%0A%0Adiff%28%5B1%2C%202%2C%203%2C%205%5D%2C%20%5B1%2C%202%2C%203%2C%204%2C%205%5D%29%3B%0A" rel="nofollow">Diff Two Arrays</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36</code>.<br>
Please describe how to reproduce this issue, and include links to screenshots if possible.</p>
<p dir="auto">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 newArr = [];

  newArr = arr1.concat(arr2);
  console.log(&quot;arr total is: &quot;,newArr);


  //count occurence of item in array
  //return number of occurrence &gt; 0
  var count = function(item, array){
    var count = 0;
    var i=0;
    for (i ; i&lt;array.length; i++){

      if (array[i] == item){
        count++;
      }
    }

    console.log(&quot;This item: &quot;+item+&quot; appears: &quot;+ count+&quot; times!&quot;);
    return count;
  };

 arr = [];

 var  y=0;
  var restOfArr = newArr.slice(0);

  for (y; y&lt;newArr.length;  y++){
     if (restOfArr.length == 0){
     console.log(&quot;EMPTY. RES IS: &quot;, arr);
     return arr;
   }
    //console.log(&quot;index is: &quot;, y);
    var item = restOfArr[0];
    console.log(&quot;item is: &quot;, item);
    restOfArr = restOfArr.slice(1);

    var counter = count(item, restOfArr);


    if (counter == 0){
      arr.push(item);
      restOfArr = restOfArr.filter(function(el){
        return el !== item;

     // console.log(&quot;after delete item restOfArr is: &quot;, restOfArr);
    });
    }
    if (counter &gt; 0){
      //ce ne sono 2 non addo
      restOfArr = restOfArr.filter(function(el){
        return el !== item;

    });
    }
    console.log(&quot;rest of arr: &quot;, restOfArr);

   // console.log(&quot;FOR: arr is: &quot;+arr+&quot; newArr is: &quot;+newArr);

  }


  return arr;
}

diff([1, 2, 3, 5], [1, 2, 3, 4, 5]);
"><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">newArr</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

  <span class="pl-s1">newArr</span> <span class="pl-c1">=</span> <span class="pl-s1">arr1</span><span class="pl-kos">.</span><span class="pl-en">concat</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-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"arr total is: "</span><span class="pl-kos">,</span><span class="pl-s1">newArr</span><span class="pl-kos">)</span><span class="pl-kos">;</span>


  <span class="pl-c">//count occurence of item in array</span>
  <span class="pl-c">//return number of occurrence &gt; 0</span>
  <span class="pl-k">var</span> <span class="pl-en">count</span> <span class="pl-c1">=</span> <span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">item</span><span class="pl-kos">,</span> <span class="pl-s1">array</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-k">var</span> <span class="pl-s1">count</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
    <span class="pl-k">var</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-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">i</span> <span class="pl-kos">;</span> <span class="pl-s1">i</span><span class="pl-c1">&lt;</span><span class="pl-s1">array</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">array</span><span class="pl-kos">[</span><span class="pl-s1">i</span><span class="pl-kos">]</span> <span class="pl-c1">==</span> <span class="pl-s1">item</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
        <span class="pl-s1">count</span><span class="pl-c1">++</span><span class="pl-kos">;</span>
      <span class="pl-kos">}</span>
    <span class="pl-kos">}</span>

    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"This item: "</span><span class="pl-c1">+</span><span class="pl-s1">item</span><span class="pl-c1">+</span><span class="pl-s">" appears: "</span><span class="pl-c1">+</span> <span class="pl-s1">count</span><span class="pl-c1">+</span><span class="pl-s">" times!"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-k">return</span> <span class="pl-s1">count</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span><span class="pl-kos">;</span>

 <span class="pl-s1">arr</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

 <span class="pl-k">var</span>  <span class="pl-s1">y</span><span class="pl-c1">=</span><span class="pl-c1">0</span><span class="pl-kos">;</span>
  <span class="pl-k">var</span> <span class="pl-s1">restOfArr</span> <span class="pl-c1">=</span> <span class="pl-s1">newArr</span><span class="pl-kos">.</span><span class="pl-en">slice</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">for</span> <span class="pl-kos">(</span><span class="pl-s1">y</span><span class="pl-kos">;</span> <span class="pl-s1">y</span><span class="pl-c1">&lt;</span><span class="pl-s1">newArr</span><span class="pl-kos">.</span><span class="pl-c1">length</span><span class="pl-kos">;</span>  <span class="pl-s1">y</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">restOfArr</span><span class="pl-kos">.</span><span class="pl-c1">length</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
     <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"EMPTY. RES IS: "</span><span class="pl-kos">,</span> <span class="pl-s1">arr</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
     <span class="pl-k">return</span> <span class="pl-s1">arr</span><span class="pl-kos">;</span>
   <span class="pl-kos">}</span>
    <span class="pl-c">//console.log("index is: ", y);</span>
    <span class="pl-k">var</span> <span class="pl-s1">item</span> <span class="pl-c1">=</span> <span class="pl-s1">restOfArr</span><span class="pl-kos">[</span><span class="pl-c1">0</span><span class="pl-kos">]</span><span class="pl-kos">;</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"item is: "</span><span class="pl-kos">,</span> <span class="pl-s1">item</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">restOfArr</span> <span class="pl-c1">=</span> <span class="pl-s1">restOfArr</span><span class="pl-kos">.</span><span class="pl-en">slice</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-k">var</span> <span class="pl-s1">counter</span> <span class="pl-c1">=</span> <span class="pl-en">count</span><span class="pl-kos">(</span><span class="pl-s1">item</span><span class="pl-kos">,</span> <span class="pl-s1">restOfArr</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">counter</span> <span class="pl-c1">==</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
      <span class="pl-s1">arr</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-s1">item</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
      <span class="pl-s1">restOfArr</span> <span class="pl-c1">=</span> <span class="pl-s1">restOfArr</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">el</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-s1">el</span> <span class="pl-c1">!==</span> <span class="pl-s1">item</span><span class="pl-kos">;</span>

     <span class="pl-c">// console.log("after delete item restOfArr is: ", restOfArr);</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</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">counter</span> <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
      <span class="pl-c">//ce ne sono 2 non addo</span>
      <span class="pl-s1">restOfArr</span> <span class="pl-c1">=</span> <span class="pl-s1">restOfArr</span><span class="pl-kos">.</span><span class="pl-en">filter</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">el</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
        <span class="pl-k">return</span> <span class="pl-s1">el</span> <span class="pl-c1">!==</span> <span class="pl-s1">item</span><span class="pl-kos">;</span>

    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span>
    <span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-s">"rest of arr: "</span><span class="pl-kos">,</span> <span class="pl-s1">restOfArr</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

   <span class="pl-c">// console.log("FOR: arr is: "+arr+" newArr is: "+newArr);</span>

  <span class="pl-kos">}</span>


  <span class="pl-k">return</span> <span class="pl-s1">arr</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">5</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-c1">2</span><span class="pl-kos">,</span> <span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-c1">4</span><span class="pl-kos">,</span> <span class="pl-c1">5</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>