var x = new func1('k'); //x.func2(); function func1(e) { function func2(){ alert(e); } return { func2 : func2() } }