Very good indeed! The first code block of the fifth proposal is a nicer, more natural way to create a singleton than the module pattern.
However, seems to me that the second block of code of the same proposal is actually a constructor function. What's the benefit from this: nextIdMod.call(subsys1); nextIdMod.call(subsys2,1000); to this: var subsys1 = new nextIdMod(); var subsys2 = new nextIdMod(1000); ? Am i missing something out? 2010/12/11 Diego Souza <[email protected]> > Great article, thank you for sharing! > > > Diego Souza > ---------------------------- > Cel: +55 (13) 9102-9980 > Twitter: twitter.com/DiegoSouza9 > GTalk / Buzz: [email protected] > > > 2010/12/7 Rey Bango <[email protected]> > >> Hi guys, >> >> Angus Croll just posted a great article about namespacing in JavaScript. >> Definitely worth the read: >> >> >> http://javascriptweblog.wordpress.com/2010/12/07/namespacing-in-javascript/ >> >> Rey.. >> >> _______________________________________________ >> JSMentors mailing list >> [email protected] >> http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com >> >> > > _______________________________________________ > JSMentors mailing list > [email protected] > http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com > > List Archive: > http://jsmentors.com/pipermail/jsmentors_jsmentors.com/ >
_______________________________________________ JSMentors mailing list [email protected] http://jsmentors.com/mailman/listinfo/jsmentors_jsmentors.com List Archive: http://jsmentors.com/pipermail/jsmentors_jsmentors.com/
