set(key, val) {
    if (this.nodesMap[key]) {
      const node = this.nodesMap[key];
      node.val = val;
      this.promote(node);
    } else {
      const node = new LinkedListNode(key, val);
      this.append(node);
    }
  }
Sets the value to cache by its key.
Time complexity: O(1) in average.
@param {string} key
@param {any} val