title: async memoized - understanding source code
body: <p>From <code>async.memoize()</code>, what does the last else block after the comment in this function do?</p>
  
  <p><a href="https://github.com/caolan/async/blob/master/lib/async.js#L671" rel="nofollow">https://github.com/caolan/async/blob/master/lib/async.js#L671</a> </p>
  
  <pre><code>async.memoize = function (fn, hasher) {
      var memo = {};
      var queues = {};
      hasher = hasher || function (x) {
          return x;
      };
      var memoized = function () {
          var args = Array.prototype.slice.call(arguments);
          var callback = args.pop();
          var key = hasher.apply(null, args);
          if (key in memo) {
              callback.apply(null, memo[key]);
          }
          else if (key in queues) {
              queues[key].push(callback);
          }
          else {
              // what does this else block do?
              queues[key] = [callback];
              fn.apply(null, args.concat([function () {
                  memo[key] = arguments;
                  var q = queues[key];
                  delete queues[key];
                  for (var i = 0, l = q.length; i &lt; l; i++) {
                    q[i].apply(null, arguments);
                  }
              }]));
          }
      };
      memoized.unmemoized = fn;
      return memoized;
  };
  </code></pre>