Skip to content

Instantly share code, notes, and snippets.

View thaycacac's full-sized avatar
🎨
Artist

Thaycacac thaycacac

🎨
Artist
View GitHub Profile
@thaycacac
thaycacac / explain-event-loop.md
Last active August 10, 2022 09:04
Frontend interview

Explain Event Loop

JavaScript is a single-threaded programming language. This means that JavaScript can do only one thing at a single point in time.

Inside Browser, there is a Javascript engine (we are considering V8 for chrome.) and an environment to run javascript properly. Javascript engine has two parts, Heap and Call Stack. And the engine has some assistant named Web APIs and Callback Queue.

Heaps

It's an unstructured memory block. Our code's memory allocation happens here. As a programmer we don't have to worry much about heaps.