Anatoly Geyfman wrote: > Cédric Bertolini wrote: >> var MyClass = (function() { >> var prototype = { /* shared attributes */ }; >> var constructor = function () { /* instance properties and bootstrapping >> */ }; >> constructor.prototype = prototype; >> return constructor; >> })();
> Cedric, good patten, makes for a convenient factory method for making > new instances - especially if you curry the prototype. I agree that it's a useful pattern. I often use something similar. But what do you mean by currying the prototype? The prototype is an object, and not a function. -- Scott -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com