What is the value of this in the imported function called from the import import ? (according to ECMA specification)
// module.js export function fun() { return this; } // main.js import * as module from "./module.js"; let x = module.fun(); // What the value of x here?
My guess would be: This is a module object, but did not find a clear answer to this in the specification. Does the normal behavior apply here or is there something special in ES6 modules for importing the namespace?
source share