JavaScript is single-threaded, but in the most popular runtimes, almost all I/O is event-based. This is a great difference from Ruby where library functions are blocking (or at least were when I last used the language many years ago).
A single thread of execution for scripts isn't so bad when those scripts are all relatively small callbacks.