Skip to content

Ashukr321/How_Javascript_Work_Internally

Repository files navigation

🟨 How JavaScript Works Internally

This repository provides a deep dive into how JavaScript works under the hood. It includes detailed diagrams (created using tldraw) and code examples.

Table of Contents

How js work pdf

  1. High level overview of JavaScript

    1. High level
    2. Garbage collected
    3. Interpreted just in time
    4. multi paradigm
    5. Prototype based object oriented
    6. First class function
    7. Dynamic in nature
    8. Single threaded
    9. non blocking event loop
  2. JavaScript Engine

    1. Heap ( object memory storage )
    2. callstack
      1. execution context.
  3. Runtime in the Browser

    1. js engine
    2. web apis
    3. callback queue
      1. microTask queue
      2. macroTask queue
    4. event loop
  4. Compilation and Interpreter Working Process

    1. compilation vs interpretation
    2. jit (just in time process);
       1.src -> parsing -> ast -> compilation -> execution  ( * again recompile go to compilation );
    
  5. Call Stack Deep Dive

    1. Global Execution Context
      1. Variable Environment
      2. Scope Chain
      3. This Keyword
    2. Execution Context
  6. Deep dive inside Execution Context

    1. Variable Environment

    2. Scope Chain

      1. Type Scope

        1. Global Scope
        2. Function Scope
        3. Block Scope

        Only variable lookup scope chain is allowed

    3. This Keywords

      1. this in normal function calling
      2. this in methods calling
      3. this in arrow function
      4. this in event listener

      this never points to itself or the variable environment

      1. call()
      2. apply()
      3. bind()
    4. Arguments keywords in Execution Context

    5. Memory Management Life Cycle

      1. Memory Allocation
        1. Call Stack
        2. Heap Memory
    6. Shallow copy and Deep copy

    7. Garbage Collection

      1. Mark and Sweep algorithms
  7. Interview Questions

Resources

About

This repository is a comprehensive deep dive into the internal workings of JavaScript. It transitions from high-level concepts to the low-level execution logic of the JS Engine, providing a roadmap for developers who want to master the "magic" behind the code.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages