Advertisement
Guest User

Untitled

a guest
Feb 25th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. var Singleton = (function () {
  2. var instance;
  3.  
  4. return function Construct () {
  5. if (instance) {
  6. return instance;
  7. }
  8. if (this && this.constructor === Construct) {
  9. instance = this;
  10. } else {
  11. return new Construct();
  12. }
  13. }
  14. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement