<h4 dir="auto">Challenge Name</h4>

<p dir="auto">Inventory Update</p>
<h4 dir="auto">Issue Description</h4>

<p dir="auto">I think i've found a solution for the challenge and when i test it, it always returns the correct answer, but there is any problem which doesn't let me continue. I've checked all the test guidelines and it works for all of them.</p>
<h4 dir="auto">Browser Information</h4>

<ul dir="auto">
<li>Browser Name, Vivaldi 1.2:</li>
<li>Operating System: Windows 7</li>
<li>Mobile, Desktop, or Tablet: Laptop SONY Vaio VGN-Z5</li>
</ul>
<h4 dir="auto">Your Code</h4>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// If relevant, paste all of your challenge code in here
var myInventory = {};

function updateInventory(arr1, arr2) {
    // All inventory must be accounted for or you're fired!
  arr1.reduce(function(anterior, actual){
    //inventory += actual[1] + '////';
    if(myInventory.hasOwnProperty(actual[1])){
      myInventory[actual[1]] += actual[0];
    } else {
      myInventory[actual[1]] = actual[0];
    }

  }, []);

  arr2.reduce(function(anterior, actual){
    //inventory += actual[1] + '////';
    if(myInventory.hasOwnProperty(actual[1])){
      myInventory[actual[1]] += actual[0];
    } else {
      myInventory[actual[1]] = actual[0];
    }

  }, []);

  var newInventory = [];

  for(var propiedad in myInventory){
    newInventory.push([myInventory[propiedad], propiedad]);
  }

  newInventory.sort(function (a, b) {
        if (a[1] &gt; b[1]) {
            return 1;
        }
        if (a[1] &lt; b[1]) {
            return -1;
        }
        return 0;
    });

  arr1 = newInventory;

 return arr1;
}

updateInventory([[21, &quot;Bowling Ball&quot;], [2, &quot;Dirty Sock&quot;], [1, &quot;Hair Pin&quot;], [5, &quot;Microphone&quot;]], [[2, &quot;Hair Pin&quot;], [3, &quot;Half-Eaten Apple&quot;], [67, &quot;Bowling Ball&quot;], [7, &quot;Toothpaste&quot;]]);

/*
// Example inventory lists
var curInv = [
    [21, &quot;Bowling Ball&quot;],
    [2, &quot;Dirty Sock&quot;],
    [1, &quot;Hair Pin&quot;],
    [5, &quot;Microphone&quot;]
];

var newInv = [
    [2, &quot;Hair Pin&quot;],
    [3, &quot;Half-Eaten Apple&quot;],
    [67, &quot;Bowling Ball&quot;],
    [7, &quot;Toothpaste&quot;]
];

//updateInventory(curInv, newInv);
*/"><pre class="notranslate"><span class="pl-c">// If relevant, paste all of your challenge code in here</span>
<span class="pl-k">var</span> <span class="pl-s1">myInventory</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">function</span> <span class="pl-en">updateInventory</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-c">// All inventory must be accounted for or you're fired!</span>
  <span class="pl-s1">arr1</span><span class="pl-kos">.</span><span class="pl-en">reduce</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">anterior</span><span class="pl-kos">,</span> <span class="pl-s1">actual</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-c">//inventory += actual[1] + '////';</span>
    <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">myInventory</span><span class="pl-kos">.</span><span class="pl-en">hasOwnProperty</span><span class="pl-kos">(</span><span class="pl-s1">actual</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><span class="pl-kos">{</span>
      <span class="pl-s1">myInventory</span><span class="pl-kos">[</span><span class="pl-s1">actual</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-c1">+=</span> <span class="pl-s1">actual</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-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
      <span class="pl-s1">myInventory</span><span class="pl-kos">[</span><span class="pl-s1">actual</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-c1">=</span> <span class="pl-s1">actual</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-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-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-s1">arr2</span><span class="pl-kos">.</span><span class="pl-en">reduce</span><span class="pl-kos">(</span><span class="pl-k">function</span><span class="pl-kos">(</span><span class="pl-s1">anterior</span><span class="pl-kos">,</span> <span class="pl-s1">actual</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-c">//inventory += actual[1] + '////';</span>
    <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">myInventory</span><span class="pl-kos">.</span><span class="pl-en">hasOwnProperty</span><span class="pl-kos">(</span><span class="pl-s1">actual</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><span class="pl-kos">{</span>
      <span class="pl-s1">myInventory</span><span class="pl-kos">[</span><span class="pl-s1">actual</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-c1">+=</span> <span class="pl-s1">actual</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-kos">}</span> <span class="pl-k">else</span> <span class="pl-kos">{</span>
      <span class="pl-s1">myInventory</span><span class="pl-kos">[</span><span class="pl-s1">actual</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-c1">=</span> <span class="pl-s1">actual</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-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-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-k">var</span> <span class="pl-s1">newInventory</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">for</span><span class="pl-kos">(</span><span class="pl-k">var</span> <span class="pl-s1">propiedad</span> <span class="pl-k">in</span> <span class="pl-s1">myInventory</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
    <span class="pl-s1">newInventory</span><span class="pl-kos">.</span><span class="pl-en">push</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-s1">myInventory</span><span class="pl-kos">[</span><span class="pl-s1">propiedad</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-s1">propiedad</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
  <span class="pl-kos">}</span>

  <span class="pl-s1">newInventory</span><span class="pl-kos">.</span><span class="pl-en">sort</span><span class="pl-kos">(</span><span class="pl-k">function</span> <span class="pl-kos">(</span><span class="pl-s1">a</span><span class="pl-kos">,</span> <span class="pl-s1">b</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">a</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">&gt;</span> <span class="pl-s1">b</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>
            <span class="pl-k">return</span> <span class="pl-c1">1</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">a</span><span class="pl-kos">[</span><span class="pl-c1">1</span><span class="pl-kos">]</span> <span class="pl-c1">&lt;</span> <span class="pl-s1">b</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>
            <span class="pl-k">return</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-k">return</span> <span class="pl-c1">0</span><span class="pl-kos">;</span>
    <span class="pl-kos">}</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

  <span class="pl-s1">arr1</span> <span class="pl-c1">=</span> <span class="pl-s1">newInventory</span><span class="pl-kos">;</span>

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

<span class="pl-en">updateInventory</span><span class="pl-kos">(</span><span class="pl-kos">[</span><span class="pl-kos">[</span><span class="pl-c1">21</span><span class="pl-kos">,</span> <span class="pl-s">"Bowling Ball"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">"Dirty Sock"</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-s">"Hair Pin"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">5</span><span class="pl-kos">,</span> <span class="pl-s">"Microphone"</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-c1">2</span><span class="pl-kos">,</span> <span class="pl-s">"Hair Pin"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">3</span><span class="pl-kos">,</span> <span class="pl-s">"Half-Eaten Apple"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">67</span><span class="pl-kos">,</span> <span class="pl-s">"Bowling Ball"</span><span class="pl-kos">]</span><span class="pl-kos">,</span> <span class="pl-kos">[</span><span class="pl-c1">7</span><span class="pl-kos">,</span> <span class="pl-s">"Toothpaste"</span><span class="pl-kos">]</span><span class="pl-kos">]</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">/*</span>
<span class="pl-c">// Example inventory lists</span>
<span class="pl-c">var curInv = [</span>
<span class="pl-c">    [21, "Bowling Ball"],</span>
<span class="pl-c">    [2, "Dirty Sock"],</span>
<span class="pl-c">    [1, "Hair Pin"],</span>
<span class="pl-c">    [5, "Microphone"]</span>
<span class="pl-c">];</span>
<span class="pl-c"></span>
<span class="pl-c">var newInv = [</span>
<span class="pl-c">    [2, "Hair Pin"],</span>
<span class="pl-c">    [3, "Half-Eaten Apple"],</span>
<span class="pl-c">    [67, "Bowling Ball"],</span>
<span class="pl-c">    [7, "Toothpaste"]</span>
<span class="pl-c">];</span>
<span class="pl-c"></span>
<span class="pl-c">//updateInventory(curInv, newInv);</span>
<span class="pl-c">*/</span></pre></div>
<h4 dir="auto">Screenshot</h4>

<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://cloud.githubusercontent.com/assets/6950370/16335034/bd20f2cc-3a04-11e6-962c-320355545794.png"><img src="https://cloud.githubusercontent.com/assets/6950370/16335034/bd20f2cc-3a04-11e6-962c-320355545794.png" alt="pruebaerror" style="max-width: 100%;"></a></p>
<p dir="auto">Challenge <a href="https://www.freecodecamp.com/challenges/use-a-css-class-to-style-an-element#?solution=%0A%3Cstyle%3E%0A%20%20.red-text%20%7B%0A%20%C2%A0%20%20color%3A%20red%3B%0A%20%20%7D%0A%3C%2Fstyle%3E%0A%0A%3Ch2%20class%3D%22red-text%22%3ECatPhotoApp%3C%2Fh2%3E%0A%0A%3Cp%3EKitty%20ipsum%20dolor%20sit%20amet%2C%20shed%20everywhere%20shed%20everywhere%20stretching%20attack%20your%20ankles%20chase%20the%20red%20dot%2C%20hairball%20run%20catnip%20eat%20the%20grass%20sniff.%3C%2Fp%3E%0A" rel="nofollow">Use a CSS Class to Style an Element</a> has an issue.<br>
User Agent is: <code class="notranslate">Mozilla/5.0 (Linux; Android 5.0; P001 Build/LRX21M) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.91 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-text-html-basic notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="
&lt;style&gt;
  .red-text {
    color: red;
  }
&lt;/style&gt;

&lt;h2 class=&quot;red-text&quot;&gt;CatPhotoApp&lt;/h2&gt;

&lt;p&gt;Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.&lt;/p&gt;
"><pre class="notranslate"><span class="pl-kos">&lt;</span><span class="pl-ent">style</span><span class="pl-kos">&gt;</span>
  .<span class="pl-c1">red-text</span> {
    col<span class="pl-c1">or</span><span class="pl-kos">:</span> <span class="pl-c1">red</span>;
  }
<span class="pl-kos">&lt;/</span><span class="pl-ent">style</span><span class="pl-kos">&gt;</span>

<span class="pl-kos">&lt;</span><span class="pl-ent">h2</span> <span class="pl-c1">class</span>="<span class="pl-s">red-text</span>"<span class="pl-kos">&gt;</span>CatPhotoApp<span class="pl-kos">&lt;/</span><span class="pl-ent">h2</span><span class="pl-kos">&gt;</span>

<span class="pl-kos">&lt;</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span>Kitty ipsum dolor sit amet, shed everywhere shed everywhere stretching attack your ankles chase the red dot, hairball run catnip eat the grass sniff.<span class="pl-kos">&lt;/</span><span class="pl-ent">p</span><span class="pl-kos">&gt;</span></pre></div>