title: SetInterval, can't assign it to a variable
body: <p>My code is like this:</p>
  
  <pre><code>$(
  
      function(){
          $("#btn").click(
          function()
          {
              var check_timer = setInterval(
                  function(){
                      console.log("here");
                      ...
                  },
                  1000
              );
  
              setTimeout(
                  function(){
                      console.log("set timeout");
                  },
                  5000
              );
  
              clearInterval(check_timer);
          });
      }
  
  )
  </code></pre>
  
  <p>so here is the question, the script won't execute the function I defined in the setInterval function, unless I remove the "var check_timer", it works fine like this:</p>
  
  <pre><code>setInterval(
      function(){
          console.log("here");
          ...
      },
      1000
  );
  </code></pre>
  
  <p>since I want to stop the job after some time, I use a clearInterval function, so I need to get the timer started by setInterval, how to fix this?</p>