title: Why is the value not set to null each time this function is called?
body: <p>Can someone explain to me why lastEventTimestamp isn't reset to null each time a function is called?</p>
  
  <pre><code>Function.prototype.throttle = function (milliseconds, context) {
      var baseFunction = this,
          lastEventTimestamp = null,
          limit = milliseconds;
  
      return function () {
          var self = context || this,
              args = arguments,
              now = Date.now();
  
          if (!lastEventTimestamp || now - lastEventTimestamp &gt;= limit) {
              lastEventTimestamp = now;
              baseFunction.apply(self, args);
          }
      };
  };
  </code></pre>