code: function toArray(set) {
      var ret = [];
      set.forEach(function(element) {
          ret.push(element);
      });
      return ret;
  }
docs: Convert a set to an array.
  
  @param {Set} set to convert
  @returns an array with the contents of the set