I'm trying to add some value to the global or local object, but nothin happens.
I'm tried create:
global.test = {};
in main.js
And to add value test[name] = value
in second js
tried create var test = {};
in second.js
And to add value test[name] = value
in second js
But this examples doesn't helped me.
Code in my files:
main.js:
global.common = require('./second.js');
global.test = {}
second.js:
module.exports = {
main: function (name, value) {
test[name] = value;
}
};
second.js invoked in another files, but the whole point is displayed in the code above.