var object = (function () { return { method: function (name) { if(name=="variable") alert("test"); } } })(); object.method( "variable" );