If I have the following:
<script type="module" src="one.js"></script>
<script type="module" src="two.js"></script>
<script type="module" src="three.js"></script>
- Am I right in saying that you cannot be 100% sure that
three.js
will be executed AFTERone.js
andtwo.js
?
However, if I have:
<script type="module">
import 'one.js'
import 'two.js'
import 'three.js'
</script>
- Am I right in saying that I can be confident that
three.js
will be executed AFTERone.js
andtwo.js
? (this is important)
Commentary on possible duplicates
I know it looks like a duplicate question, but please keep in mind that the aim of this question is to confirm the very different behaviour of importing via HTML and via JavaScript