function merge(arg) {
        // undefined inputs always return undefined
        if (typeof arg === 'undefined') {
            return undefined;
        }

        var result = {};

        arg.forEach(function (obj) {
            for (var prop in obj) {
                result[prop] = obj[prop];
            }
        });
        return result;
    }
Merges an array of objects into a single object.  Duplicate properties are
overridden by entries later in the array
@param {*} arg - the objects to merge
@returns {*} - the object