function createRangeIterator(start, stop) {
  let value = start;
  const next = () => {
    if (value < stop) {
      return {value: value++, done: false};
    }

    return {value: undefined, done: true};
  };

  return /** @type {!Iterator<number>} */ ({next});
}
Create an Iterator starting at start and increments up to
(but not including) stop.
@param {number} start
@param {number} stop
@return {!Iterator<number>}