Converts an array to an object where the keys are the array entries and the values are customizable in a function.