bluehost-banner
Creation Phase & Execution Phase in JavaScript

Creation Phase & Execution Phase in JavaScript

Now Let's explore how an execution context is created by the JavaScript engine, which we have seen in the previous article, and how the JavaScript engine controls the execution context.

In this article, we will learn what is creation phase and execution phase in javascript.

Basically, the Execution context has two pahses:1) Creation phase and 2) Execution phase

1) Creation phase :

For Each Function(function Declaration) property is created in the variable object, which is pointing to that function.

For each variable(Variable Declaration) property is created in the variable Object, Which is then set to undefined

Arguments Objects are created that were passed into the function

In other words this process is also called Hoisting.

Hoisting is a javascript mechanism where variables and function declarations are moved to the top of their scope before the code execution.

2) Execution phase:

Current Execution context run line by line.

Subscribe to our Newsletter

Stay up to date! Get all the latest posts delivered straight to your inbox.

If You Appreciate What We Do Here On TutsCoder, You Should Consider:

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Leave a Comment