Let's see how it works.
for demo purpose, I created an index.html and math .mjs, script.mjs.
you can create .js extension its, not a problem but use a .mjs extension for the consistency to know what are the modules and what are the scripts?.
in above code, I created two functions and exported it.
Now, these functions are available to import.
At final we are creating the HTML file with our modules.
we need to specify the type in script tag for the modules mime type is the module.so that browser treated it as a module rather than normal script.
in above code 15th line I used to tell the browser it is not a module and if the modules are not supported in browsers please use this fallback.js.
final output is
Hope you guys love these.