I agree. Singletons are less of a design pattern and more of a work-around for the limitation of languages that only let you use classes and nothing else.
And apart from some sense of "this must be readable because I'm using design patterns" I think most people will find
// Singleton.jsexportconstSingleton={name:"John"};// some other fileimport{Singleton}from"...";
way more readable than the 2 different files presented in the example, with so much ceremony around what you are actually trying to accomplish.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree. Singletons are less of a design pattern and more of a work-around for the limitation of languages that only let you use classes and nothing else.
And apart from some sense of "this must be readable because I'm using design patterns" I think most people will find
way more readable than the 2 different files presented in the example, with so much ceremony around what you are actually trying to accomplish.