code: function collectProperties(groups, properties) { 
    var collection = {};
    for (var key in groups) {
      if (Array.isArray(groups[key])) {
        collection[key] = groups[key].reduce(function(coll, item) {
          properties.forEach(function(prop) { 
            if (!coll[prop]) coll[prop] = [];
            coll[prop] = coll[prop].concat(propertyAt(item,prop));
          })
          return coll;
        }, {})
      } else {
        collection[key] = collectProperties(groups[key], properties);
      }
    }
    return collection;
  }
docs: collect the properties in an array