How does javascript execute code + call stack | chai aur #javascript

preview_player
Показать описание
#javascript #hindi
Sara code yaha milta h

Discord pe yaha paaye jaate h:
Instagram pe yaha paaye jaate h:
Рекомендации по теме
Комментарии
Автор

1.JS creates Global excution context
2.Next it creates memory phase
3.Memory phase - In this phase, the variables are set to undefined
until the execution phase(next phase) and the functions are set to their definitions.
4.Next it creates the execution phase
5.Execution phase - In this phase, the variables are initialsed to given values and
when the function s are called, it creates a memory phase and execution phase for the function
just like the main one.

For live demo:
browser > inspect > Sources
create a snippet with few functions and visually experience the call stack.

correct me if there are any mistakes or add to this if something is missing.

OnesAndZeros_
Автор

I am having two years experience as a front-end developer but the things cleared here that was no one explain. Even not talked about, so thanks a lot for your way of teaching. 👏👏

rupeshpal
Автор

That what making this tut standout from other because you're advance concepts in basic and covering all complex concepts in early stage..keep going

learncode
Автор

🔵The working of the JavaScript works on three phases:
1. Global Execution Context
2. Memory phase / Creation phase
3. Execution phase

🔵Phase 1: Global Execution Context
The value of `this` keyword is set to Global Execution Context (which is an empty Object in NODE environment, & window object in browser environment)

🔵Phase 2: Memory phase
During this phase, JS engine scans the code and assigns the initial values for the variables, functions, etc.. For variables they are 'undefined' and for functions they are set to their function definition

🔵Phase 3: Execution phase
After the creation phase completed, the execution phase begins where actual values of the variables are set. And when the functions are called it creates a new 'Function Execution' context which consists of two phases (they works same as explained above but only for the particular function scope):
1. Memory phase
2. Execution phase
📝The return value of the 'Function Execution' context is passed to the Global Execution Context

Amazing videos Hitesh Sir,
Learning a lot..!!
🔴Correct me if something I explained is Wrong

harshalkhobragade
Автор

Honestly, no one has every explained like this before. u really deserve appreciation....

mansoorafzal
Автор

Seen first time how program runs in memory!
Thnx Hitesh ji!
I was waiting for this to understand since 2011...!

nitinmore
Автор

brilliant video, no one explains such complex topics with such ease, LEGENDARY

__divyanshusrivastava
Автор

very good understanding 💯 with chai aur code thank thanks mr. hitesh choudhary sir

There are three types of execution contexts in JavaScript:
Global execution context: This is the default execution context that is created when the code is executed in a global scope.
Function execution context: This is the execution context that is created when a function is called.
Eval execution context: This is the execution context that is created when the eval() function is called

nitishsingh
Автор

Amazing video i never seen a educator who teach and talked about any language & in its components in this depth....
Thanku for this and please post more videos like this ...

music_
Автор

Global Execution Context contains two phases 1. memory component 2. code execution component --- In memory component memory is reserved for variables(initially assinged with undefined) and functions(assigned with defination) whereas in code execution component all assignment of variables, calculations etc. are performed.

Yuvraj-Singh
Автор

Sir this video was much needed. Coding toh theek hai practice se aa jaati hai lekin yeh in depth baatein aage interviews mein kaafi acha impression bana ti hai.
This is a good and in depth video

HydroJudge
Автор

one of the best video of an entire js series I have
I love it

LegendXo_OP
Автор

hatsoff to you.... I landed to watch your react video, but in react video you said, dont watch it if you dont know javascript.... That was turning point for, coz I never heard a youtuber says, dont watch this if you you dont know that first....
In fact I bought a code on udemy for react, but couldn't complete as the person used all advance concept of JS, but in the begining he said, you can learn react even ifyou are naive to JS...Believe me I couldn't complete... its still there... BIG SALUTE TO YOUR TEACHING STYLE.... WORLD IS RUNNING COZ OF GIVERS LIKE YOU :)

ramansworld
Автор

Ek saal se jyada hone ke baad iss video ko dekh raha hu. Pr quality last year se abhi tak mei kahin nahi mili aisi. Isse clearly pata chalta hai ki @chaiaurcode kaafi teachers se 1 saal pehle hi itna cover karke bethe the. Thanks for the work sir. We'll appriciate your work and yes, things will come up. Let's see

Freak_
Автор

Huge respect to you sir for making this
series of java script
🙏🙏🙏🙏🙏

Tripathiji
Автор

Very depth explanation after 4 years of working today I understand how JavaScript exactly works... Thanks Hitesh sir...i have seen many other videos but not understood

HetalSheladiya-ld
Автор

Thank you so much for such clear explaination of Global context execution, functional context execution and call stack. This video is very helpful.

sindhurapogarthi
Автор

Honestly, no one has explain like this. u really deserve appreciation....👍👍👍

anasshaikh-ww
Автор

This free video is more effective and full of real content than paid courses. Really doing the great job with the content and the selection of important topics.

harvindersingh
Автор

This is the best detailed video in all of youTube , Keep up the Good Work!
You are a great teacher, Thanks!

Mojo_._Jojo