We have a global object in javascript that we can refer to using window for accessing any global variable. But how to refer to the module scope object where all the variables in that module are stored?
Actually, I need to refer to an imported object in the module using string. If it was a global variable, I could've simply done this,
let object_I_want = window[string];
But for module, I can't find the reference for such object. I also tried using this,
var scope = this;
somefunction(){
let object_I_want = scope[string];
}
But, this is undefined inside module context according to the specification. Is there a way to reference the module scope/module object like window.