1

-1. JavaScript Engine Introduction-

<h3>HOW DOES JS ENGINE WORK?</h3>

To communicate with the computer there is a language these only understand and are binary language. Coders write instructions in JavaScript but when this is executed in the browser there is an engine that compiles JavaScript into that binary language so the computer knows how to build the website. This process is called “Just in time compiler”.

<h3>V8, JS ENGINE OF CHROME.</h3>

V8 Engine was born thanks to Google, allowing running faster the Apps and giving the power to JavaScript.

Nowadays V8 is a famous engine open source used for many browsers and not only Frontend but also Backend. Node is JavaScript in Backend that runs thanks to V8.

<h3>WHAT DOES THE ENGINE.</h3>

The engine once gets the code from the JavaScript file it does choose the main object “global object” that would be a window and its “this” references. After this process, it starts to create the “AST (Abstract syntax tree)” to be interpreted and Finally translate it into Bytecode that the computer can understand.

Also, before translated the Engine will optimize the code but this helps can bring some problems like the “hosting” between variables and function.

<h3>GLOBAL OBJECT AND HOISTING.</h3>

It would be said that the window object it’s out of our code. It is the object made from APIS (methods and properties) that the engine will take firstly to build up the website and these are those links to the object’s variables.

Hoisting is made because before ES6 the Engine of JavaScript interpreted the variables and functions, place them in “memory hip” too late when used it shows the value or result. But if there is no value assigned in the case of the variables and it is executed then the own engine will assign and undefine value. But after ES6 “let” and “const” made more strict this methodology of the Engine, is a bad practice to use “var” as it was done before.

Escribe tu comentario
+ 2