code: function iteratorFor(items) {
    const iterator = {
      next() {
        const value = items.shift();
        return {
          done: value === undefined,
          value
        };
      }
    };
  
    if (isSupportIterable) {
      iterator[Symbol.iterator] = () => iterator;
    }
  
    return iterator;
  }
docs: Build a destructive iterator for the value list https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Iteration_protocols