3 ms·
why: what's your reasoning for using them? A more memory-efficient approach: var Person = (function(){ function Person(x){ this.x = x
by ricardobeat 14y ago
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
})()