2 ms·
if you want something like a singleton why do you just: var singleton = function (args) { /*object constructor stuff*/ }(arg-values)
by dantheman 18y ago
if you want something like a singleton why do you just:
var singleton = function (args) {
/*object constructor stuff*/
}(arg-values)
- jmtulloss 18y agoThat's another way to do it. The problem is that this way and other ways are not similar, making it hard to go from one form to the other. It's also not the same as declaring a class. I talk a bit more about what I'm trying to fix earlier: http://justin.harmonize.fm/index.php/2008/12/a-better-object-oriented-javascript/ http://justin.harmonize.fm/index.php/2008/12/a-better-object...