code: function shift() {
    // todo: handle special case when limit === 1
    const entry = this.head;
    if (entry) {
      if (this.head.newer) {
        // advance the list
        this.head = this.head.newer;
        this.head.older = undefined;
      } else {
        // the cache is exhausted
        this.head = undefined;
        this.tail = undefined;
      }
      // Remove last strong reference to <entry> and remove links from the purged
      // entry being returned:
      entry.newer = undefined;
      entry.older = undefined;
      // delete is slow, but we need to do this to avoid uncontrollable growth:
      delete this._keymap[entry.key];
      this.size -= 1;
    }
    return entry;
  }
docs: Purge the least recently used (oldest) entry from the cache. Returns the
  removed entry or undefined if the cache was empty.
  
  If you need to perform any form of finalization of purged items, this is a
  good place to do it. Simply override/replace this function:
  
  var c = new LruCache(123);
  c.shift = function() {
  var entry = LruCache.prototype.shift.call(this);
  doSomethingWith(entry);
  return entry;
  }