phant.js
function(paramd, defaultd) {
    if (paramd === undefined) {
        return defaultd
    }

    for (var key in defaultd) {
        var pvalue = paramd[key]
        if (pvalue === undefined) {
            paramd[key] = defaultd[key]
        }
    }

    return paramd;
}
function(paramd, defaultd) {
    if (paramd === undefined) {
        return defaultd
    }

    for (var key in defaultd) {
        var pvalue = paramd[key]
        if (pvalue === undefined) {
            paramd[key] = defaultd[key]
        }
    }

    return paramd;
}
function ( paramd , defaultd ) { if ( paramd === undefined ) { return defaultd } for ( var key in defaultd ) { var pvalue = paramd [ key ] if ( pvalue === undefined ) { paramd [ key ] = defaultd [ key ] } } return paramd ; }
Make sure a 'paramd' is properly set up. That is,
that it's a dictionary and if any values in defaultd
are undefined in paramd, they're copied over
Make sure a paramd is properly set up . That is that it s a dictionary and if any values in defaultd are undefined in paramd they re copied over