• Node, bun là JS runtime
FeatureJavaScript Engine 🏎JavaScript Runtime 🌍
DefinitionA program that parses, compiles, and executes JavaScript codeThe complete environment that allows JavaScript to run (including the engine + APIs)
PurposeConverts JS code into machine code and runs itProvides everything JS needs to run (I/O, APIs, etc.)
IncludesJust the JS execution engineJS engine + Web APIs (browser) or system APIs (Node.js, Bun)
Example Engines🔹 V8 (Chrome, Node.js)
🔹 SpiderMonkey (Firefox)
🔹 JavaScriptCore (Safari)
🔹 Browser (Chrome, Firefox, Safari)
🔹 Node.js
🔹 Deno
🔹 Bun
Runs InsideA runtime environment like a browser or Node.jsA browser or standalone runtime (Node.js, Bun, Deno)
  • A JavaScript engine is a program that takes raw JavaScript code, compiles it into machine code, and executes it.

✅ JavaScript running in the browser runtime → Client-side code
✅ JavaScript running in the server runtime (Node.js, Bun) → Server-side code