code: function toJSON() {
    const s = [];
    let entry = this.head;
    while (entry) {
      s.push({ key: entry.key.toJSON(), value: entry.value.toJSON() });
      entry = entry.newer;
    }
    return s;
  }
docs: Returns a JSON (array) representation