code: function indexForKey (array, key) {
    for (var i = 0; i < array.length; i++) {
      if (array[i]['.key'] === key) {
        return i
      }
    }
    /* istanbul ignore next */
    return -1
  }
docs: Find the index for an object with given key.
  
  @param {array} array
  @param {string} key
  @return {number}