Facebook Pixel
The JavaScript Runtime Environment Explained

Is setTimeout part of the JavaScript language?

The answer

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.

More FAQs in The JavaScript Runtime Environment Explained

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.

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.

Still have questions?

Browse all our FAQs or reach out to our support team

Want to upskill yourself?

Your learning library

Small steps. Big possibilities.

Find your next course. Build something great.

Our courses are taking a Coffee break, but your curiosity shouldn't. Stay engaged with namastedev linkedin, youtube, discord and other resources while you wait.

0
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.
Please Login.