var params = 'header.slogan', obj = {props: {header : {slogan : "всякая фигня"}}}; function fun(obj,params) { return params.split(".").reduce(function(ob, key) { return ob[key] },obj) } alert(fun(obj.props , params));