Converts an array into a dictionary. Dictionary values are keyed by the return of the specified `getKey`.