How does Javascript works on a single thread even though you can use SetTimeout kind of methods.
Anonymous
As long as you dont block the main thread, there are APIs(Web API, nodejs API) to handle those async processes in the background. Those APIs run executions at parallel and put the output on queue. When main thread runs all the processes, event loop pushes those outputs to main thread.
Check out your Company Bowl for anonymous work chats.