DEV Community

loading...

Discussion on: Singleton Pattern in JavaScript

Collapse
aakatev profile image
Artem Author

This assumption is correct. That said, you should not use new keyword with this pattern. You can add a function to explicitly initialize singleton, and it would look more like traditional "Java" singleton. I don't think the latter is necessary though.