0

I am curious if it is possible to import a module directly inside an object. What I mean by that is, we usually have:

import myModule from './mymodule';

this way I have MyModule as a global variable inside my code. Would be possible to have something like

const myObj = {};
myObj.myModule = [add here my module from import] 

without using some global variables? if it is possible, would be good approach?

Gabriel Lopes
  • 943
  • 6
  • 11
  • 20

0 Answers0