One example of macrotask is event listener callback.
One example of microtask is the
then in a promises.
Js engine event loop has two queues: one queue for the macrotask, another queue for the microtask.
It will execute one things from the macrotask queue, then execute everything on the microtask queue, then perform rerender.