code: function collect(iterator) {
      var result = [];
  
      for (;;) {
          var item = iterator.next();
          if (item.done) {
              break;
          }
          result.push(item.value);
      }
  
      return result;
  }
docs: ////////////////////////////////////////////////////////////////////////////// Library: Collections ////////////////////////////////////////////////////////////////////////////// 
  Collects items from an iterator into an array.
  
  <p>
  The iterator follows a subset of the ES6 specifications: an object with the property "next" which is a function returning the next item specification. An item specification consists in two properties: "done" to indicate whether there are no more elements (when it's true) or not, and "value" which corresponds to the value of the item.
  </p>
  
  @param {Object} iterator The iterator used to get items, see description for more details about its interface
  
  @return {Array} The collected items as an array