This content is amazing! This is exactly what I was looking for. Thank you. I'm only 2 minutes into the video, and I had to pause it to make this comment.
Wow! Thank you very much for such a nice and clear presentation which is quite easier to understand for beginners like me. I was a lot confused with the course I took currently, that's why, I look around and found yours as the best explanation so far.👍👍👍
Ah, so this is where the supposed solution to Global Execution Context being removed from the Stack is. Why do so many guides to advanced JavaScript refer to the Stack that still has GEC on it "empty"? That was always the confusing part to me as popping off the GEC from the Stack means that the script (program) has finished executing completely. And when you also understand that callbacks run after all functions have been popped off the Stack first, how can any function that also relies on global variables even execute afterwards without any errors, if the variables have been *garbage collected* from the Memory Heap? So in such guides, this was always the part not being explained properly - *how* and *where* does JavaScript keep values if GEC gets removed from the Stack and with it, removes all references to variables? How does this mystical code even work as asynchronous, if the variables or other values that were being stored in its memory, *get deleted* after GEC gets removed from the Stack? And the simple answer to this question: GEC *DOES NOT* get popped off the Stack as long as the Tab it runs in (environment) remains open.
If the asynchronous callback has closure over any variables, even if the callstack is empty and the callback is yet to be queued for execution the variables will remain in memory until they are unreachable.
thanks sir.. but i wanna one question .I have seen var self = this in some function .. kindly can you describe this topic .I will be very thankful to you
This content is amazing! This is exactly what I was looking for. Thank you. I'm only 2 minutes into the video, and I had to pause it to make this comment.
Glad it was helpful!
Wow! Thank you very much for such a nice and clear presentation which is quite easier to understand for beginners like me. I was a lot confused with the course I took currently, that's why, I look around and found yours as the best explanation so far.👍👍👍
Great tutorial....Really enjoyed this javascript execution context
amazing content!
Ah, so this is where the supposed solution to Global Execution Context being removed from the Stack is.
Why do so many guides to advanced JavaScript refer to the Stack that still has GEC on it "empty"?
That was always the confusing part to me as popping off the GEC from the Stack means that the script (program) has finished executing completely. And when you also understand that callbacks run after all functions have been popped off the Stack first, how can any function that also relies on global variables even execute afterwards without any errors, if the variables have been *garbage collected* from the Memory Heap?
So in such guides, this was always the part not being explained properly - *how* and *where* does JavaScript keep values if GEC gets removed from the Stack and with it, removes all references to variables? How does this mystical code even work as asynchronous, if the variables or other values that were being stored in its memory, *get deleted* after GEC gets removed from the Stack?
And the simple answer to this question:
GEC *DOES NOT* get popped off the Stack as long as the Tab it runs in (environment) remains open.
If the asynchronous callback has closure over any variables, even if the callstack is empty and the callback is yet to be queued for execution the variables will remain in memory until they are unreachable.
Hello would you kindly share your slides?
It would be so helpful for learning thank you!
thanks sir.. but i wanna one question .I have seen var self = this in some function .. kindly can you describe this topic .I will be very thankful to you
Hi Farooq. Yes, in next few lectures I will explain this topic in detail.
best bro thank you!
ver ver y goos sir.
Woow