title: keydown event incosistently responds to multiple keys being pressed
body: <p>I'm using <code>keydown</code> and <code>keyup</code> events to track which keys are currently being pressed, but the results are somewhat incosistent. If I'm holding left arrow (<code>37</code>) and up arrow (<code>38</code>) and try to hold space (<code>32</code>) it doesn't get detected. However if I'm holding right arrow (<code>39</code>) instead of left, I can press space and it works just fine. Is the implementation wrong or could it be a bug in the browser? I've tested on Chrome and Firefox and got the same results.</p>
  <p>Here's my code:</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>let activeKeys = [];
  
  window.addEventListener('keydown', (e) =&gt; {
    activeKeys[e.keyCode] = true;
    updateList();
  });
  
  window.addEventListener('keyup', (e) =&gt; {
    activeKeys[e.keyCode] = false;
    updateList();
  });
  
  let updateList = () =&gt; {
    let div = document.getElementById('test');
    let html = '';
  
    for (let keyCode in activeKeys) {
      if (activeKeys[keyCode]) html += `&lt;p&gt;${keyCode}&lt;/p&gt;`;
    }
  
    div.innerHTML = html;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div id="test"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>