JavaScript runs on a single thread, but many operations (network requests, timers, file I/O in Node, etc.) are asynchronous. This means they can start now and finish later without blocking the main thread.
Modern JavaScript offers async
/await
syntax built on top of Promises
for a clean, linear style.