A javascript equivalent for toDictionary (c#)
When providing an object, I don't think it makes sense to pass the index into the callbacks. Rather, pass in the current key.

Also, I think reduce reads much clearer here:

_.dictionary = function (source, keyGenerator, valueGenerator) {
    if (Array.isArray(source)) {
        return source.reduce(function (output, value, index) {
            output[keyGenerator(value, index)] = valueGenerator(value, index);
            return output;
        }, {});
    }

    return Object.keys(source).reduce(function (output, key) {
        output[keyGenerator(source[key], key)] = valueGenerator(source[key], key);
        return output;
    }, {});
};


See it here in action: https://jsfiddle.net/e4g4p7wy/