JS working

JS is a single threaded language that can be non-blocking.

What is Program?

  • allocating memory ( for variables ).

  • parsing (read) and executing (run)

JavaScript Engine:

  • Memory Heap

  • Call stack

Memory Leak:

When the unused variables are increased with huge data, this occurs. so global variables are not preferable.

Call Stack:

Reads the function and push it into the stack, executes the function and pops out the stack.

First In Last Out or Last In First Out.

Single Threaded:

It means having only one call stack.

Why Single thread?

Running a code in single thread is quite easy, since it don't have to deal with complected scenarios that rise in multi threaded environment. We have one thing to worry about. We can avoid deadlock as it is in Multi threaded.

Synchronous:

Code is executed only after the previous line of the code is executed.

Stack Overflow:

It is occurred when the call stack is full, no space for the execution.

JavaScript Run-Time:

Last updated