Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Singleton() {
- if(typeof Singleton.instance === "object") {
- return Singleton.instance; //accessible from outside
- }
- //do something...
- Singleton.instance = this;
- //imply return this object
- //return this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement