title: Function continues running even after set to undefined
body: <p>I've written a wrapped around an API service, which creates a special function, <code>next</code>, which calls itself with the next page of data. It allows me to do stuff like:</p>
  
  <pre><code>let req = getSomeData({ param: true }, function(err, res) {
      // Do something
      if (res.next) {
          res.next();
      } else {
          // All data processed
      }
  }) 
  </code></pre>
  
  <p>If I want to stop this automatic pagination early, I assumed I could just set <code>req = null</code>, and it would stop it running again, however the callback function continues to be run.</p>
  
  <p>A minimalistic example is below:</p>
  
  <pre><code>var parent = function() {
  
    var runner = function(func) {
      var next = function() {
        return runner(func);
      }
  
      func(next)
    }
  
    var handler = function(next) {
      console.log('handler called')
      setTimeout(next, 2000);
    }
  
    runner(handler);
  }
  
  var child = new parent();
  
  setTimeout(function() {
    console.log('killing child');
    child = undefined;
    console.log('child is ' + typeof child);
  }, 5000)
  </code></pre>
  
  <p>Even though after 5 seconds <code>child = undefined</code>, the handler function continues to be called every two seconds.</p>
  
  <p>Demo: <a href="http://jsbin.com/tuyebacavi/1/edit?js,console" rel="nofollow noreferrer">http://jsbin.com/tuyebacavi/1/edit?js,console</a></p>