JavaScript code runs single threaded. There is just one thing happening at a time.
This is good because devs dont need to worry about concurrency issues, the only caveat is to know how not to block that single thread like synchronous network calls or infinite loops.
In most browser there is an event loop for every browser tab, in other words, the environment manages multiple concurrent event loops, to handle API calls for example, Web Workers run in their own event loop as well.
You mainly need to be concerned that your code will run on a single event loop, and write code with this thing in mind to avoid blocking it.