Read this post about the javascript event queue and see if it answers most of your questions. There will be a native OS thread that handles the interaction with real OS events (mouse events, keyboard events, timer events, network I / O events, etc.), and then they are sent to the JS queue, where the JS mechanism can send them to javascript code. How many separate threads at the OS level has implementation specificity and probably depends on the implementation.
source share