What is a JavaScript runtime environment?
The engine (V8) plus the host-provided Web APIs, microtask and macrotask queues, and the event loop. The engine provides the call stack and heap; the host provides async APIs and the event loop.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in The JavaScript Runtime Environment Explained
No. The event loop is part of the host environment (browser or Node.js/libuv). The engine (V8) provides the call stack and heap. The host provides the event loop, Web APIs, and queues.
Because they have different host environments. The browser provides DOM, window, fetch, localStorage. Node.js provides fs, http, process, Buffer. Both use V8 as the engine, but the APIs and event loop differ.
No. setTimeout is a Web API provided by the browser (or Node.js). The JS spec does not define it. The engine (V8) does not know about timers; the host environment provides them.
Still have questions?
Browse all our FAQs or reach out to our support team
