The Browser

When you write Javascript, how does the browser understand what’s been written?

Well, this is handle by a javascript engine and different browsers have different javascript engine

Lets focus on the most popular browser or should i say my favourite browser, Google Chrome.

V8 engine

Google Chrome uses the javascript engine called v8 engine.

“So what’s the purpose of the v8 engine , you may ask ,well the same purpose like any other javascript engine , that is to convert javascript code to binary so that the computer can understand .

Components of the V8 engine

The engine consists of two main components :

Memory Heap — this is where the memory allocation happens

Call Stack — this is to keep track of where we are in the code execution

How do we get to machine code ?

To get to machine code , your javascript file will either have to be compiled or interpeted .

Compilation — the entire source code is converted into machine code at once.

Interpretation — in interpretation , there is an interpreter which runs through the source code and executes it line by line.

Is Javascript compiled or interpreted ?

Javascript used to be a purely interpreted language but the problem with interpreted languages is that they are much, much slower than compiled languages.

Modern Javascript engine now uses a mix between compilation and interpretation which is called just -in-time(JIT) compilation.




I am a full-stack web developer javascript specialist Front-End

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Create a Boilerplate in TypeScript With Node Package Manager, MongoDB, Express, Node, &…

Getting Started with Server-Sent Events and understanding when to use Polling, WebSockets, and SSE

Refactoring a Class Component to a Functional Component, with Hooks

Social Login with React, Rails API, Devise Auth Token

Jest Snapshot Tests For .tsx File


Events Handling in JavaScript

Years-to-save: the long and longer work of first-time buyers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Amina laabidi

Amina laabidi

I am a full-stack web developer javascript specialist Front-End

More from Medium

I also don't like computers anymore

How to Turn Your Old Smartphones into New Home Security Cameras

The Internet is Easy, and Other Boldface Lies

Meet the Woman Who Programmed the First Personal Computer