1. Memory Heap
An unstructured region of memory where global variables and objects are stored.
2. Event loop
This pulls functions out of the event or callback queue and places it in the call stack when it becomes empty.
3. Call Stack
4. Event queue
This holds mostly async functions processed by the web APIs so that when they are ready to run, the event loop can pull from it and add to the callstack.
This occurs when a function is being declared and returned in another function and this is done so that the inner function can have access to the scope of the outer function even after the outer function has been executed.
7. Lexical Scope
This is the region in which a block of code has access to the variables defined in that scope.
The promise object has methods like
These keywords make handling asynchronous code more readable. The
async keyword makes a function return a promise while the