code: function groupBy(keySelector, elementSelector, resultSelector, keyComparator) {
                  __assertFunction(keySelector);
                  __assertFunction(elementSelector);
                  __assert(__isUndefined(resultSelector) || __isFunction(resultSelector), 'resultSelector must be undefined or function!');
                  __assertFunction(keyComparator);
                  var groups = new Map();
                  var result = void 0;
                  var _iteratorNormalCompletion13 = true;
                  var _didIteratorError13 = false;
                  var _iteratorError13 = undefined;
  
                  try {
                      for (var _iterator13 = self[Symbol.iterator](), _step13; !(_iteratorNormalCompletion13 = (_step13 = _iterator13.next()).done); _iteratorNormalCompletion13 = true) {
                          var val = _step13.value;
  
                          // Instead of checking groups.has we use our custom function since we want to treat some keys as equal even if they aren't for the Map
                          var key = __Collection.__getEqualKey(groups, keySelector(val), keyComparator);
                          var elem = elementSelector(val);
                          if (groups.has(key)) {
                              groups.get(key).push(elem);
                          } else {
                              groups.set(key, [elem]);
                          }
                      }
                  } catch (err) {
                      _didIteratorError13 = true;
                      _iteratorError13 = err;
                  } finally {
                      try {
                          if (!_iteratorNormalCompletion13 && _iterator13.return) {
                              _iterator13.return();
                          }
                      } finally {
                          if (_didIteratorError13) {
                              throw _iteratorError13;
                          }
                      }
                  }
  
                  if (resultSelector) {
                      // If we want to select the final result with the resultSelector, we use the built-in Select function and retrieve a new Collection
                      result = __Collection.from(groups).select(function (g) {
                          return resultSelector.apply(undefined, _toConsumableArray(g));
                      });
                  } else {
                      // our result is just the groups -> return the Map
                      result = groups;
                  }
                  return result;
              }
docs: /*
  This is the "basic" function to use. The others just transform their parameters to be used with this one.