Re:Preparing Yourself for Modern JavaScript Development
by ricardobeat on Saturday July 07, 2012 @04:40PM
(#4212651)
why: what's your reasoning for using them?
A more memory-efficient approach:
var Person = (function(){
function Person(x){
this.x = x
}
function myPrivateMethod(x){
//...
}
Person.prototype.something = function(){
y = myPrivateMethod(this.x)
}
return Person
})()
A more memory-efficient approach: