title: interval not getting cleared by clearInterval()
body: <p>I've been playing around with canvas and I'm trying to make a square that moves and jumps, the moving part is done, but the jumping part has an issue: it jumps faster every time you jump</p>
  
  <p><a href="http://jsfiddle.net/a6duzpzu/" rel="nofollow">here's a jsfiddle</a></p>
  
  <p>and here's the code:</p>
  
  <pre><code>///////////////////////////////////////////////////////////////////////////////
  //                                 VARIABLES                                 //
  ///////////////////////////////////////////////////////////////////////////////
  
  var canvas = document.getElementById("arena");
  var ctx = canvas.getContext("2d");
  
  var square = new Player("#330099", 32, 32);
  
  var keys = [];
  var velX = 0;
  var speed = 50;
  var friction = 0.8;
  var jumping = false;
  var jumpInterval;
  
  
  
  ///////////////////////////////////////////////////////////////////////////////
  //                                  OBJECTS                                  //
  ///////////////////////////////////////////////////////////////////////////////
  
  function Player(color, width, height, jumpHeight, drawAction){
      this.color = color || "#000000";
      this.width = width || 50;
      this.height = height || 50;
      this.jumpHeight = jumpHeight || 100;
      this.x = canvas.width/2;
      this.y = canvas.height-this.height;
      this.draw = drawAction || function(){
          ctx.fillStyle = this.color;
          ctx.fillRect(this.x, this.y, this.width, this.height);
      };
  };
  
  
  
  ///////////////////////////////////////////////////////////////////////////////
  //                              EVENT LISTENERS                              //
  ///////////////////////////////////////////////////////////////////////////////
  
  document.body.addEventListener("keydown", function (e) {
      keys[e.keyCode] = true;
  });
  document.body.addEventListener("keyup", function (e) {
      keys[e.keyCode] = false;
  });
  
  
  
  ///////////////////////////////////////////////////////////////////////////////
  //                                 FUNCTIONS                                 //
  ///////////////////////////////////////////////////////////////////////////////
  
  function Jump(){
      if(jumping == true){
          if(square.y+square.height &gt; canvas.height-square.jumpHeight){
              square.y--;
              console.log("jumping");
          } else { jumping = false; console.log("peak reached"); }
      }
  
      if(jumping == false){
          if(square.y &lt; canvas.height-square.height){ square.y++; console.log("falling"); }
          else { clearInterval(jumpInterval); console.log("interval cleaned"); }
      }
  }
  
  
  
  ///////////////////////////////////////////////////////////////////////////////
  //                               UPDATE &amp; DRAW                               //
  ///////////////////////////////////////////////////////////////////////////////
  
  function update(){
      window.requestAnimationFrame(update);
  
      if(keys[37]){ //left arrow
          if(velX &gt; -speed){
              velX--;
          }
      }
      if(keys[39]){ //right arrow
          if(velX &lt; speed){
              velX++;
          }
      }
  
      if(keys[32]){ //space bar
          if(jumping == false){
              jumping = true;
          }
  
          jumpInterval = setInterval(Jump, 10);
      }
  
      /*
      if(keys[39] == false){
          jumping = false;
          jumpInterval = setInterval(Jump, 10);
      }
      */
  
      if(velX != 0){
          velX *= friction;
      }
  
      square.x += velX;
  
      draw()
  }
  
  function draw(){
      ctx.clearRect(0, 0, canvas.width, canvas.height);
  
      square.draw();
  }
  
  update()
  </code></pre>
  
  <p>the console constantly prints out "interval cleaned" so it looks like it's not actually clearing it.</p>
  
  <p>which means that there's more and more intervals every time I jump, which would explain that issue, except that I have no idea why it's not getting cleared!</p>
  
  <p>(it also seems to go faster when I move to the right and jump)</p>