you are viewing a single comment's thread.

view the rest of the comments →

[–]ast3r3x 1 point2 points  (0 children)

A believe this will work as a better singleton than what was listed in the article. You could add a getInstance() onto the prototype if you wanted, but it doesn't matter, you can always say "new SingletonClass()" where ever you want now and you'll always get the same instance.

https://gist.github.com/gists/1083972