function ff(a,b){ this.a=a; this.x=ss; } ff.prototype.ss = function (b){ alert(b); }; var a=new ff(1,2); alert(a.a); a.x();