title: JS holding down a key has a delay
body: <p>I am learning  JavaScript and I am trying to program a small game. 
  I want that something in my game moves consistently while I hold down a key. 
  This is what I came up with so far: </p>
  
  <pre><code>document.onkeydown = onKeyDownListener;
  
  function onKeyDownListener(evt) {
      var keyCode = evt.which || evt.keyCode;
      if(keyCode == 37) {
          move();
      }
  }
  </code></pre>
  
  <p>My problem is that when I press down the key move gets called once, then there is a pause and after that pause move gets called repeatedly as I intend. It goes 
  like this: m......mmmmmmmmm when 'm' stands for move and'.' is the pause. 
  Is there a way to get rid of the pause?</p>
  
  <p>Here is a GIF of what happens: </p>
  
  <p><a href="https://i.stack.imgur.com/nxCkT.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nxCkT.gif" alt="GIF of my problem"></a></p>