JavaScript RunTime

JavaScript run time is created when the code is executed. (Call Stack + Memory Heap + Web API + Event Loop + Call back Queue)

Web API: Asynchronous functionality.

Working process:

  • When the code executed, JavaScript run time is created.

  • When the function are pushed into the call stack, the functions belonged to Web API will be send to the Web API by call stack for he process.

  • When the web API receives the function, it will process the functions, and then it is send to the call back queue.

  • Then the processed function in the call back queue will be send to the event loop to send to the call stack.

  • After receiving the processed function, event loop pushes the function to the call stack, when it is empty. ( waits until the call stack is empty )

  • Then the function will be executed in the call stack.

Last updated