DEV Community

loading...

Discussion on: Singleton Pattern in Javascript

Collapse
bibekkakati profile image
Bibek Author

Hey Mahamed Belkheir, you are right we can create one-off object instance directly. I prefer to follow the common implementation way of these design patterns. It also helps to understand the code better if someone is coming from other language. At last, in javascript we have two choices, modularisation approach or singleton approach.

Forem Open with the Forem app