Javascript is essentially single-threaded which means that events are not processed in parallel. If an event occurs while a previous one is still being processed it will be added to a queue. Events will be processed in the order in which they occur but they have to wait until previous ones have completed.
One thing which can happen while an event is being processed is the loading of an image from a file. We will look at that on the next page.
There are certain other things that can work in parallel but they add complications which are not needed for the kind of games considered here.