code: function keyBy (arr, key) {
    var obj = {}
    arr.map(x => obj[x[key]] = x)
    return obj
  }
docs: Turn an array of objects into a new object of objects where the keys are
  given by the value of `key` in each child object.
  @param {[Object]} arr - The array of objects.
  @param {String} key - The key to look for.