function calculateOptions(options) {

            // copy the default options so we don't accidentally modify them
            var defaultCopy = extend(true, {}, defaultOptions);

            var result;
            if (typeof options === 'object') {
                // extend modified the "target" variable
                result = extend(defaultCopy, options);
            } else {
                // no options were passed
                result = defaultOptions;
            }

            return result;
        }
// messy way to calculate default options without jquery.extend
messy way to calculate default options without jquery.extend
messy way to calculate default options without jquery . extend
function calculateOptions(options) {
            var defaultCopy = extend(true, {}, defaultOptions);
            var result;
            if (typeof options === 'object') {
                result = extend(defaultCopy, options);
            } else {
                result = defaultOptions;
            }
            return result;
        }
function calculateOptions ( options ) { var defaultCopy = extend ( true , { } , defaultOptions ) ; var result ; if ( typeof options === 'object' ) { result = extend ( defaultCopy , options ) ; } else { result = defaultOptions ; } return result ; }
messy way to calculate default options without jquery.extend
messy way to calculate default options without jquery . extend
// copy the default options so we don't accidentally modify them // extend modified the "target" variable // no options were passed