JavaScript Engines, Memory Heaps and Call Stacks

Vedanth bora
2 min readJun 3, 2021

The javascript code we write executes in the browser. But….. the browser doesnt understand javascript code. What does it understand then?

What it understands is bits (0’s AND 1's). So who can help us here?

Yes!! Javascript engines can. There are a lot of javascript engines out there written by some really cool, smart folks. For example: Chrome’s V8 engine is written in c++(yes, they can be programmed too and be written in different programming languages too!).

Okay.., so what is a rendering engine? A rendering engine compiles the css and the styles.

Uhhhh…, So whats inside a javascript engine?

ever heard of a memory leak? So the memory heap has limited space. so the unused memory has data leak into it, like when we use global scope variables.

the same with stack overflow! the call stack also has limited space so when the call stack gets filled its called stack overflow, eg. when we call a recursive function (infinite loop)

Hope this was a fun read :).

--

--