javascript - How to add self executing function inside a constructor function -
i create constructor like
function foo (){ this.bar=function(){ //something }; }
this fine till here wanna add inside self executing function when create object new keyword might this
function foo(){ (function(){ //do create object })(); this.bar=function(){ //something }; }
i want run self executing function when create new object . how can wrote above
Comments
Post a Comment