lundi 2 novembre 2015

Javascript: protect global variables

I am coming from C++ background, where if you have declared a namespace or class, its identifier cannot be overwritten, but in JS I just easily can create a global variable with the name of the most important namespace in the project, and ruin the entire project!

How do you, js developers, deal with it? Is there a possibility to fix global variables? If not, then how do you manage to work with big projects in JS?

Aucun commentaire:

Enregistrer un commentaire