I am working on a javascript SDK which works in browser, here they have used window.someVariableName
to store a data. We wanted that variable to be accessible any where in javascript code, but this expose the internal variables to the user, which is not secure.
Is there any standard way to handle this?
I created a singleton class in javascript and added all variables in that class with getters and setters.
New contributor
Chetan Lohkare is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.