I have a page with one external script file. Inside this script 3 global objects are used:
var oArticle = new Article();
var oUiManager = new UiManager();
var oController = new Controller();
I was suggested today to put them all into one object, for example inside exercisePage:
var exercisePage = {
"oArticle": new Article(),
"oUiManager": new UiManager(),
"oController": new Controller()
};
What are the benefits of such approach if I'm using only one script file for the page?