Modern JavaScript allows defining modules right on the Html page:
</body>
<script type="module">
export let Var0 = 2;
</script>
<script type="module">
import { Var0 } from "";
</script>
</body>
Browser (in my case Chrome) does not complain on the type="module"
specifier. Without this specifier it complains on the export statement. First script passes without errors. It looks like a module. But how can I import anything from it? Inline or external script requires the module name that I should specify in the import
statement.
Is there any way to give a name to a <script>
section?