var params = {
result: 'default'
};
function getParams(what) {
var par = params;
if (what) {
par.result = what;
}
return par;
}
var def = getParams();
var non_def = getParams('non-default');
console.log(def);
console.log(non_def);