Ask coding questions

← Back to all posts
array from module is not an Array?
pegasusroe (8)

In my repl, I made an array from module.js. From the module's log, the array is still an Array, but from the index.js log, it's not an Array anymore, why?

Coder100 (17126)

have you tried printing it out?

pegasusroe (8)

@Coder100 I think I'm kind of getting it. Modules have their own execution context, so ObjectFromModule !== Object.
👉 see: instanceof & multiple context