I'm trying sublet big single source code to small modules. I want to use same variable name on each jsfile. But them are required on mainjs file.
Does it makes any problem?
require('./module1');
require('./module2');
let obj = new Something();
let obj = new Something();
Each module is a separate entity and you can use same variables in different modules. But not same variables in a single module. By means of a separate entity is that stack of variables are maintained separately for each module when its complied.