code: function groupBy (arr, key) {
    return arr.reduce((sum, item) => {
      const groupByVal = item[key]
      var groupedItems = sum[groupByVal] || []
      groupedItems.push(item)
      sum[groupByVal] = groupedItems
      return sum
    }, {})
  }
docs: /* util extracted out from remix-ide. @TODO split this file, cause it mix real util fn with solidity related stuff ...