<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Event Loop</title>
</head>
<body>
<button onclick="demonstrateEventLoop()">Запустить</button>
<script>
function demonstrateEventLoop() {
console.log("1. Начало выполнения");
setTimeout(function () {
console.log("3. setTimeout выполнен");
}, 0);
console.log("2. Синхронный код выполнен");
}
</script>
</body>
</html>