JavaScript V8 Engine Explained

JavaScript V8 Engine Explained

You often come across the term "build on Chrome's V8 engine." and The most Well Known Example will be the formal definition of nodeJs. Well I have been hearing V8 a million times during this lockdown period. So what exactly is this Chrome's V8 engine and what does it do?

So, Yes V8 is Google's open source high performance javascript engine, written in C++ (V8 documentation) but what does this actually mean? V8 translates JavaScript code directly into machine code so that computers can actually understand it, then it executes the translated, or compiled, code. V8 optimizes JavaScript execution as well.Machine code is a language that CPUs can understand. It is purely digital, meaning made up of digits.

V8 Does: 1)Compiles and executes JS code, 2)Managing memory allocation for objects — the memory heap 3)Garbage collection — of objects which are no longer in use

V8 Doesn't: Know anything about the Document Object Model (DOM) — which is provided by the browser, and obviously irrelevant to Node.js

Simply speaking V8 is a c++ program that receives javascript code, compiles and executes it and it is something that NodeJs is build on.