text: import _groupWith from "../privates/_groupWith";
  
  /**
   * Transforms an array-like object into a lookup table using the provided iteratee as a grouping
   * criterion to generate keys and values.
   * @example
   * const persons = [
   *     {"name": "Jane", "city": "New York"},
   *     {"name": "John", "city": "New York"},
   *     {"name": "Mario", "city": "Rome"},
   *     {"name": "Paolo"}
   * ];
   * const getCity = _.getKey("city");
   * const personsByCity = _.group(persons, getCity);
   *
   * // "personsByCity" holds:
   * // {
   * //     "New York": [
   * //         {"name": "Jane", "city": "New York"},
   * //         {"name": "John", "city": "New York"}
   * //     ],
   * //     "Rome": [
   * //         {"name": "Mario", "city": "Rome"}
   * //     ],
   * //     "undefined": [
   * //         {"name": "Paolo"}
   * //     ]
   * // }
   *
   * @example <caption>Adding a custom value for missing keys:</caption>
   *
   * const getCityOrUnknown = _.adapter([getCity, _.always("Unknown")]);
   *
   * const personsByCity = _.group(persons, getCityOrUnknown);
   *
   * // "personsByCity" holds:
   * // {
   * //     "New York": [
   * //         {"name": "Jane", "city": "New York"},
   * //         {"name": "John", "city": "New York"}
   * //     ],
   * //     "Rome": [
   * //         {"name": "Mario", "city": "Rome"}
   * //     ],
   * //     "Unknown": [
   * //         {"name": "Paolo"}
   * //     ]
   * // }
   *
   * @memberof module:lamb
   * @category Array
   * @function
   * @see {@link module:lamb.groupBy|groupBy}
   * @see {@link module:lamb.count|count}, {@link module:lamb.countBy|countBy}
   * @see {@link module:lamb.index|index}, {@link module:lamb.indexBy|indexBy}
   * @since 0.7.0
   * @param {ArrayLike} arrayLike
   * @param {ListIteratorCallback} iteratee
   * @returns {Object}
   */
  var group = _groupWith(function (a, b) {
      if (!a) {
          return [b];
      }
  
      a[a.length] = b;
  
      return a;
  });
  
  export default group;
  