Grid Dynamics interview question

How is working Event-loop in JS