Answer the question
In order to leave comments, you need to log in
Why is the code execution order different in Chrome and Firefox?
Code like this:
<script>
setTimeout(function() {
alert('setTimeout-1')
}, 0);
setTimeout(function() {
alert('setTimeout-2')
}, 0);
setTimeout(function() {
alert('setTimeout-3')
}, 0);
</script>
<p>paragraph-1</p>
<script>
alert('one');
</script>
<p>paragraph-2</p>
<script>
alert('two');
</script>
<p>paragraph-3</p>
<script>
alert('three');
</script>
<p>paragraph-4</p>
<script>
alert('four');
</script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question