Skip to content

Commit

Permalink
Merge pull request #271 from AashishSinghal/master
Browse files Browse the repository at this point in the history
+ Q451 Answer
  • Loading branch information
sudheerj committed Jun 10, 2024
2 parents dcb3ba4 + 0a208a2 commit c18a37c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8426,6 +8426,13 @@ Here are some common use cases of closures:
**[⬆ Back to Top](#table-of-contents)**
451. ### What are the phases of execution context?
The execution context in JavaScript is a data structure that stores the information necessary for executing a piece of code. It includes the code itself, the values of the variables used in the code, and the scope chain. The scope chain is a list of objects that are used to resolve variable names.
The execution context has two phases:
* Creation phase: In this phase, the JavaScript engine creates the execution context and sets up the script's environment. This includes creating the variable object and the scope chain.
* Execution phase: In this phase, the JavaScript engine executes the code in the execution context. This includes evaluating expressions, assigning values to variables, and calling functions.
The execution context is created when a function is called. The function's code is then executed in the execution context. When the function returns, the execution context is destroyed.
**[⬆ Back to Top](#table-of-contents)**
Expand Down

0 comments on commit c18a37c

Please sign in to comment.