es2015/equals.js
function iteratorToArray(iterator) {
  let elements = []
  
  for (let element of iterator) {
    elements.push(element)
  }
  
  return elements
}
function iteratorToArray(iterator) {
  let elements = []
  
  for (let element of iterator) {
    elements.push(element)
  }
  
  return elements
}
function iteratorToArray ( iterator ) { let elements = [ ] for ( let element of iterator ) { elements . push ( element ) } return elements }
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.
Traverses the provided finite iterator or iterable object and returns an array of generated values .