The WHATWG spec defines algorithm steps describing how the event loop is processed. However, I find it not easy to discover the place(s) in the spec when these steps get execution. To put it in other words, when, specifically, the event loop gets run?
From internet papers and SO answers I know that it should happen just after the currently running JS script come to its end, but I am a bit confused by these words from the spec:
An event loop must continually run through the following steps for as long as it exists
How the notion of continual event loop running can be related to the fact that no task can get execution during the time the "high level" script (that inside <script>) is running?
Does it mean this script itself is a task scheduled in the event loop? Still, I can't find prove in the spec.