# Event Loop

How does JavaScript actually work?

First, let's look at what JavaScript are. JavaScript is a single-threaded non-blocking asynchronous concurrent language. JavaScript has a call stack, an event loop, a callback queue, some other apis and stuff. Does v8 also has these things? No, v8 has a call stack and a heap.

About the call stack

Means one thread == one call stack == one thing at a time.

As the JavaScript runtime can do only one thing at a time, how the things happened concurrently. This is because the browser gives us these other things, gives us these web APIs. Those pieces of the browser are aware of this concurrency kicks in.

How about in node environment? Instead of the web APIs we have C++ APIs and the threading is being hidden from you by C++.