url_path_join = function () {
        /**
         * join a sequence of url components with '/'
         */
        var url = '';
        for (var i = 0; i < arguments.length; i++) {
            if (arguments[i] === '') {
                continue;
            }
            if (url.length > 0 && url[url.length - 1] != '/') {
                url = url + '/' + arguments[i];
            } else {
                url = url + arguments[i];
            }
        }
        url = url.replace(/\/\/+/, '/');
        return url;
    }
wrapper around contructor to avoid requiring `var a = new constructor()`
useful for passing constructors as callbacks,
not for programmer laziness.
from http://programmers.stackexchange.com/questions/118798