I have an empty html page with 2 scripts:
<script src="./scripta.js"></script>
<script src="./scriptb.js"></script>
scripta.js:
console.log("from a")
setTimeout(() => {
console.log("from a timeout")
}, 0)
scriptb.js
console.log("from b")
Now, when I refresh the page I mostly see those logs in my console:
from a
from b
from a timeout
That's how it's supposed to be from my understanding.
However, after reloading page multiple times I've noticed those logs too:
from a
from a timeout
from b
Can someone explain or point me to an answer why I see the second variation of logs? Thanks.