Single-threaded nature, JavaScript execution model, and browser vs Node.js environment
JavaScript runs user code on a single main thread, but hosts like browsers and Node.js provide different APIs around that execution model.
- One call stack runs JS code
- Hosts provide timers, I/O, and APIs
- Browser and Node.js expose different globals and capabilities
Single-threaded nature, JavaScript execution model, and browser vs Node.js environment