function keyBy( collection, fcn, thisArg ) {
	var out;
	var len;
	var key;
	var i;
	if ( !isCollection( collection ) ) {
		throw new TypeError( format( 'invalid argument. First argument must be a collection. Value: `%s`.', collection ) );
	}
	if ( !isFunction( fcn ) ) {
		throw new TypeError( format( 'invalid argument. Second argument must be a function. Value: `%s`.', fcn ) );
	}
	len = collection.length;
	out = {};
	for ( i = 0; i < len; i++ ) {
		key = fcn.call( thisArg, collection[ i ], i );
		out[ key ] = collection[ i ];
	}
	return out;
}
Converts a collection to an object whose keys are determined by a provided function and whose values are the collection values.

@param {Collection} collection - input collection
@param {Function} fcn - function to invoke
@param {*} [thisArg] - execution context
@throws {TypeError} first argument must be an object
@throws {TypeError} second argument must be a function
@returns {Object} output object

@example
function toKey( value, index ) {
    console.log( '%d: %s', index, JSON.stringify( value ) );
    return value.name;
}

var collection = [
    { 'name': 'beep', 'a': 1 },
    { 'name': 'boop', 'b': 2 }
];

var obj = keyBy( collection, toKey );
// returns { 'beep': { 'name': 'beep', 'a': 1 }, 'boop': { 'name': 'boop', 'b': 2 } }