how to avoid accessing name space object.
window.myApp = window.myApp || {};
myApp.Base.Controller = myApp.extend({});
myApp.Base.Model = myApp.extend({});
myApp.Base.View = myApp.extend({});
here i am attaching everything to the myApp and myApp will be avail in window object.
how can i hide myApp Object accessing from window level.
As @Człowiek Fin Śpiewak already suggested, you can wrap the code in an IIFE:
(function(){
var myApp = {};
myApp.Base.Controller = myApp.extend({});
myApp.Base.Model = myApp.extend({});
myApp.Base.View = myApp.extend({});
})();
I also suggest looking into require.js