I didn't realize why my browsers (Firefox, iOS Safari) were correctly handling the tests, despite the article indicating they were not compliant. Then I realized the article is from 2015.
The content is still really useful, though. A good understanding of JS tasks & microtasks and HTML jobs is really useful for diagnosing the inevitable front-end weirdness encountered during development when using any of the major frontend frameworks (which contain a lot of abstraction that separates the developer from these lower-level facets).
This has been on my bookmark list since I read it many years ago and I reread it whenever I have to refresh on js fundamentals. Kudos for resurfacing it.
Looking at the starting example, I thought "script start" should happen first. "promise2" should be after "promise1", but the rest seem arbitrary, and you shouldn't be writing code where it would matter.
The setTimeout(..., 0) is important to be able to force things to be at the end of the queue after the current task completes. So if you are going to batch requests, your current task can create a bunch that all queue somewhere, and then setTimeout(..., 0) can be used to dispatch them all at once.
The content is still really useful, though. A good understanding of JS tasks & microtasks and HTML jobs is really useful for diagnosing the inevitable front-end weirdness encountered during development when using any of the major frontend frameworks (which contain a lot of abstraction that separates the developer from these lower-level facets).