ℹ️ Import/Export
⚖️

ℹ️ Import/Export

📝instruction

  1. first we create two modules suppose module1.js and module2.js
  1. Then module2.js →→→
notion image
  1. Then module3.js→→→
notion image
  1. Now if you run this then it will throw an error then there is one solution that : we will convert this to .js to .mjs extension
  1. Then it will work but only that variable is used that is by default is exporting in the module2.mjs
  1. If we want to excess all the variable declared in module2.js then we have to do like that→→
    1. export{a};
    2. export{b};
    3. export{c};
      1. notion image
  1. Now you can excess this in the module1.mjs like this→ →
notion image