I know, using the words JavaScript and \'atomic\'-anything in the same sentence is kinda strange, since JavaScript is prised to be asynchronous and therefor not very atomic.
JavaScript is inherently single-threaded. This means that if AJAX response arrives or timeout/interval should be triggered but other code is running, the response callback/timeout will wait.
This was one of the primary reasons why JavaScript was chosen for node.js.
See also: