0
comment
comment
on 2/6/2014 9:59 AM
For many projects I’ve been using the pattern:
ns.CtorFunction = function(){
var self = this;
this.doStuff = function(){
// do stuff and use self in order to get the object variables
}
}
Turns out that this pattern is good for small sites with jQuery (that makes use of this in other ways). For larger code bases where you have lots of code this construction sometimes makes it difficult for the garbage collector. If you have a large single page app, then this might be an issue.
What [...]