I have file1.js :
View = function(){
var privateprop;
this.method=function(){
...
}
}
and file 2 like this:
subView = new function(){
var privateProp2;
this.method2= function(){
}
}
I want an instance of subView in file1.js like:
var fileObj = new subView();
fileObj.method2();
can I access this directly ? I mean can I access classes(actually functions) defined in file2.js in file1.js directly? Dont we need any imports in Javascript?