index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<style>
p {
color: red;
}
</style>
<script src="script.js"></script>
<!-- <script>
console.log('script 1 starts');
for (let i = 0; i < 3e9; i++) {}
console.log('script 1 ends');
</script> -->
</head>
<body>
<p>paragraph</p>
<script src="script2.js"></script>
<style>
p {
color: blue;
}
</style>
</body>
</html>
script.js:
console.log('script 1 starts');
for (let i = 0; i < 3e9; i++) {}
console.log('script 1 ends');
script2.js:
console.log('script 2 starts');
for (let i = 0; i < 3e9; i++) {}
console.log('script 2 ends');
When I run this HTML file in the browser what I see is:
If I comment out external script in the and comment in inline then I see: