We are starting a new project and we have decided to use javascript “”namespaces”” to organize our client side code. The thing is that we have noticed that we can end very easily with super-long namespaces that are dificult to remember like
myProject.components.myComponent.doSomethig();
Is there any better way to do this or create some kind of “alias” somehow?
Thanks.
In JavaScript, you can make shortcut references to long namespaces stuff
This is a reference only. You can do this with other long names and write less like this
Also you can organize your code with RequireJS to organize your code
// file: myProject/components/myComponent.js
// file: myProject/main.js
// file: myProject/index.html