code: function iteratorToArray(iterator) {
    let elements = []
    
    for (let element of iterator) {
      elements.push(element)
    }
    
    return elements
  }
docs: Traverses the provided finite iterator or iterable object and returns an
  array of generated values.
  
  @param {({[Symbol.iterator]: function(): {next: function(): {value: *, done: boolean}}}|{next: function(): {value: *, done: boolean}})} iterator
  The iterator or iterable object.
  @return {*[]} The elements generated by the iterator.