Transcript for:
JavaScript Variable Creation and Execution

Hi everyone. In this video, we will see that the code of JavaScript that we wrote in the last video, how it is executed line by line and how it gives us results. How variables are created in our memory. Although we saw in the last video how variables are created, but it is not exactly like that. Variables are created in two steps and values are assigned to them. We will see all of them in-depth in this video. Here I have created a small project. Here is an HTML file and a JavaScript file connected to it. These are the two files. There is nothing much here. Our JavaScript file is connected to HTML. And I have written just h1 in it. Then I have written some code in JavaScript. I will give the entire starter code in the description. Download it from there and then start coding. Here in JavaScript, I have created a variable using a var. FirstName. Then I have created a lastName variable using let. Then I have created a var. using let. And then I have created a var. using yearOfBirth. I have used const. Because the year of birth does not change. That is why I have used const. I have created four variables. Then I have created a user intro using let. Then I have added firstName and lastName. So it will be Hi, my name is Akash Singh. We have not used age and year of birth. Just let it be written like this. So let's understand that this is actually like we have written six lines of code. So how does it execute line by line? So we saw in the last video that as soon as JavaScript encounters our first variable, it will create a memory. It will put the value of Akash in it. It will put the value of the string. Then the same thing will happen for lastName. Then it will be for age. It will put 15 in it for age, which is a number. So as soon as it puts a number in it, the type of the entire memory location, the data type will change and become a number. So all this happens. Everything is absolutely right. But how does it exactly happen? It happens in two steps. So let's go and see how it happens. But before that, if we come here and see, if I type firstName here, then I am getting Akash. If I type lastName, then I am getting Singh. If I type age, then I am getting 15. So it seems like everything is done in one go. The variable has been created from firstName and we have assigned this string to it. So it doesn't happen like that. If we go to our blackboard, this is our blackboard which we created in the last video. To explain variables in JavaScript, I created all these boxes. And I said this is our memory location. The name of the variable, like username, age, will be labeled here. Then its value will be set. And the type of the value in this memory, I wrote the type of here. So this is what I did. So this doesn't happen exactly like this. It happens in two steps. Once the memory is created, and it is kept undefined. So let me explain. I have created a blackboard here. When we run the JavaScript code, this will be var firstName. So this will run twice in the first time. The first phase is called memory creation phase. In the first time, only memory is created and a name is given to it. It doesn't even have a value. JavaScript has an undefined value in it. So let's see how it happens. As soon as we run this code, the JavaScript engine will scan it quickly. It will scan it from top to bottom. It doesn't have to do any operation. It will neither plus, nor minus, nor assign a value. It will do nothing. First, it will look for var, let, or const. It is looking for it. When the memory creation phase is running for the first time, it is looking for var, let, or const. It saw var in the first line. When it saw var, it will create a memory. Let me create a memory. One second. I have created it. Let me give it a background color. I have given it. It has created a memory. It will give a name to it. What will be the name? FirstName. Let me copy it. Let me write it here. It is a little big. Let me make it smaller. It will give FirstName. What will it keep inside? Inside this, immediately, in the first time itself, it will not keep Akash. It will keep Undefined. It will keep Undefined inside. When it will keep Undefined, what will be its type? Its type will also be Undefined. The type of Undefined is Undefined. The type of Undefined is Undefined. Undefined is a value, but its type is also Undefined. Its type will also be Undefined. When we move forward, it will encounter the lastName. The lastName will be exactly the same. Let me group it. Let me duplicate it and keep it here. Inside this, it will also be Undefined. Its name will be LastName. It will do this too. It is creating a memory. This is the lastName. The lastName is also done. After this, the age variable will come. It will also create an age. It will create an age here. In the case of age, it will also keep Undefined. It does not care about the number or the string. It will keep Undefined in the first time. We will do age here and it will keep Undefined. Like this. Inside this, it will also be Undefined. Then there is the year of birth. Inside this, it will also be Undefined. I have done this. Here, I will copy this from here. In the first time, it will only do this much. This phase is called the memory creation phase. This means that our memory is being created. What is happening here? Our memory is being created. The name is being given on the memory. Basically, the Javascript engine is telling us that when the actual code will be executed, when the actual code will be executed, then we will need a variable with a firstName, a variable with a lastName, an age variable and a year of birth. It is reserving the memory for all this. In the starting, it is keeping Undefined. All this will be done. Here, we are adding this. We are adding Hi, my name is firstName and lastName. This addition and addition will not perform anything. Here, you write console.log. You write console.log. I will write age. I will write age. I will write firstName. At the time of memory creation phase, it will not write this line. I have not written console.log. I have written console.log. I had to write console.log. What will it do at the memory creation phase? It will skip this line. Line number 6. It will skip this line. It is just looking for this line. It will create a box and keep adding Undefined. Then what will happen? When it will run again, when the code execution phase will come, now the memory creation phase is running, when the code execution phase will come, then values will go inside it. Like we wrote this, Akash. We will copy this. Here, we will make it in a bigger group. We will name it memory creation phase. I will put it inside a rectangle. I will give solid color to this rectangle. How will the solid color look? I will send it back. It will go like this. Like this. Solid color doesn't look good. I will make the color transparent. Something like this will look good. This is the memory creation phase. Then I will write memory creation here. Whatever I am writing on the blackboard, its image or PDF format, I will give you in the description. You can download it and go through it later. You can review it later. This is the memory creation phase. I will duplicate it. Again, what will happen? Code execution phase. Memory is created. Memory is allocated. Every variable is named and memory is allocated. It is undefined in the memory. It was an engine of JavaScript. Actual code will run and actual value will be stored there. If I write code execution phase here, it is duplicated but my box is not duplicated. I will group all of them. I will duplicate it and create code execution phase here. In code execution phase, code will be executed. Actual value will be stored in the string. Number will be stored in the number. I will change it to code execution phase. This is code execution phase. Here, undefined will be replaced. Undefined will be replaced by the value in the first name. Undefined will be replaced by the value in the second name. Undefined will be replaced by the value in the third name. It will be changed by the type in the string. This type change will be ok, string. This will be a string and then the same thing will happen here too. Here this change will be ok, sing. This is sing and here this undefined will also change and become a string. As soon as the value comes in it, sing, it will become a string. string. s-t-r-i-n-g. This is a string and in the same case, the value will come in it, 15 or whatever the age is. Where is this age 15 and I have kept this date of birth. So no problem, let's put 15 here. And the type of this will be number. The type of this will be number and here too the value we assigned will come. 1999 and the type of this will be the type of this will also be number. Here. So it will be something like this. First, in the memory creation phase, only the memory will be located in each name and in all of them, undefined will be put. And then as soon as the code execution phase starts, in all those memories, the actual memory created where the code was undefined will be replaced by the actual value. For example, in the first name, there was Akash, so Akash will go. In the last name, there was Singh, so Singh will go. And in the age, 15 will go. By the way, 15 and age are not matching, but no problem. According to the date of birth, according to the year of birth, nothing is matching. So no problem, we are just writing like this to try. So here, in the age, 15 will go and in the year of birth, 19 and 99 will go. And when the actual value will come, its type will also change to the actual type. So can we pause the memory creation phase in our DevTools? It is not like that. We cannot pause the memory creation phase. We can pause the code execution. So now, we will pause the code execution and see. We will pause the code execution and see that the memory creation phase is running. We will see the memory creation phase running and undefined will be seen in it. So we cannot pause at the time of memory creation. But we can pause just before the execution. And we can pause anywhere in the phase of execution. So let's see here. So see, in the first time, our entire memory will be created. Then when the actual code execution will happen, then our, like I wrote console log, and this line will not run first. So in the first name, this value will go. Then the actual value will go. Like I wrote console log first. I wrote console log first here. So see what will happen. Here, in our memory, our memory has been created. The code execution has not happened yet. Imagine, this is not the case. The code execution has not happened yet. The memory has been created. The first time when our code was scanned, when Javascript scanned our code, it saw the keyword let var and constant. For that, the memory was stored. So here, for this, we did not create the memory for user intro. So no problem. I will comment this now. If I press control slash with control, it will be comment out. So for now, comment this out. So Javascript will not touch that commented line. So I will comment this out. Later, we will uncomment it if needed. So when it created the memory for the first time, it kept all the values undefined. So in our memory, it is undefined. So when the actual code execution will start, this will be our first line encounter. So here, this execution has not happened yet. In the first name, our Akash value has not gone. When this line will run, this value will go in the last. So now we will pause and see. We will pause and see. We will see how the value is going in it. We will press the button and the value will go in it. So now you guess what will be the value of this? What will be the value of the first name? So in the first name, it is undefined. So we will get the value of undefined. See here, this is mine. The output of the console is coming here. So in script.js, from line number 1, it is undefined. So now, the value is undefined. If you check the typeof, the typeof is also undefined. Because the value is undefined and the type is also undefined. See here, the type is also undefined. So when we write the typeof, see here, it is a little dark. It is a little highlighted. It is a little more white. But if we remove the typeof, it is actually undefined. Undefined is a little light color. It is a little dark. So in this case, when we are doing typeof, a string is being printed from here. So when we saw here, let me do one thing. If I write hello here, if I write hello here, see here, it is coming like this. But if I write hello here, if I write hello here like this, it is coming in green color. It is coming in green color and what we have printed through console.log, it is coming in white color. If I print this again, when I print through console.log, it comes in white color. Our string comes in white color. And let's print our number and see what color it comes. If I print number, the color of number comes in actual color. Which was coming here. Like we did here, the color of number was coming in blue color. So the color of number is correct, but the string is of white color. So when I say hello here, it is coming in white color. So when I do console.log from here, if I do any string from console.log, it will not show in single quote, it will show in white color. So if I reload, it is showing in white color and it is not showing in green color. Like we can see here, when we type in console, the output of string comes in green color. It is in light blue color and it is visible in single quote. So that's why when we do type of first name here, if we do type of first name here, it will be type of. Like if I do type of here, so now type of which is first name is done. Till the time we are typing here, JavaScript code is executed and first name has Akash's value in it. And if we do type of first name here, so string is coming here. But if I do it here, if I do here, where variable is done, so string is coming here. But there is a difference because we printed it through console. That's why string is coming in white color and string in green color is coming in single quote. So when string is in white color, it is a string. So you can see type of what is coming here. If we put everything in bracket, what will happen after evaluating? A string will come whose value will be undefined. You can also check type of for that. Type of first name. So this will be a string actually. This is a string. This might be a little confusing, so no problem. I will just do ctrl z. So here it is done. Type of first name is a string. Type of first name is undefined because it is a string. But if I remove type of here and just do first name, it is coming in light color and not visible properly. It is a little dull color. So this means this is actual value. This is actual value and this is type of and string. So this is actual value inside this and type of is here. Type of is above this, so when code is not executed yet, just memory was created, so in first name, we got undefined. So undefined came here. So if we remove type of, we get actual value. So undefined is coming from undefined. And if we try last name, then what will happen? Then error will come. We saw in last video. Same thing is happening in this case also. Memory is being created and undefined is being stored there also. But this last name is a new thing. It came in 2015. So there is a restriction that before putting actual value you will not be able to access. What is the benefit of accessing? When undefined is there, you will not get actual value. So there is a little extra validation that when you put value in it, you will be able to use it after that. So in case of var, it was an old thing. It was there since when javascript was made. So we could use it earlier also. And whatever was in memory at that time, we got its value. So if I rename it first name again, and if I come here, we will pause and see that in case of let, that thing is happening. In case of let, value is coming there and undefined is being stored there also. In case of var, a variable is being created and undefined is being stored there also. The first memory creation phase. So if I make it bigger, I will come to sources tab. If it is not visible, click here. I will come to sources tab. And here if you hover, it is called debugger. So what is debugger? Basically if we put it, our code will stop here. When we will reload, the whole program will stop. So if I put debugger, not debugger, it is also called breakpoint. I mean, we have put a break point here, so that our code breaks here. Not break, I mean, a break is put on the code. So, if I reload it, see what happens. The moment I reload it, see, it has stopped here, it is loading here. And our HTML has not come yet. What was visible for a while, I will remove it again and reload it normally. So, the h1 we wrote in our HTML is coming. And when I bring the debugger and reload it, it will be visible for a while because it is already here. But when our page is reloaded properly, it will disappear from here and it will not be visible either. Now see, wait a little, it will disappear. Ideally, it should disappear immediately. But it is cached with Chrome, so it is not disappearing immediately, but it has disappeared. So, see what happened. Now, let's understand what is happening here again. And our HTML is not coming and it is showing loading here. So, as long as we stop on it, it will keep loading. So, what is happening here, if we come inside the HTML file, our browser is sending a request to index.html. And this is the server of our live server, which we have created using the extension of the live server. So, it sends this index.html file to our browser. It has sent this index.html file. So, from line number 1, our browser starts understanding HTML. So, it understands one by one. Then it gets this line with the title. So, it executes this line. It executes this line and puts our title here. It put the title. And then what happens after that? After that, it gets this line, script.js. So, what it does is, our browser was reading index.html, which is the engine of HTML. It is called HTML parser. So, the HTML parser was reading it and then it sent a request to script.js. So, basically, our index.html file sent a request to script.js. We can see all this in the network tab. Let's go to the network tab once. And clear it once here. And make sure your filter is not on. Just click on all. By default, it can be like this. But if you click on it, the filter for all will appear like this. So, let's leave it as all. And if we reload it, then it comes here immediately. But because we put a debugger here, it jumped and came here from the network. But if you look here, then where did it go? We can move it up a little. I think we will have to zoom out a little. So, what happened now? It sent a request to index.html file in our browser. And its initiator was other. I told this very well in the video of watch this before learning HTML. Which is the second video of bootcamp. This is after the internet video. It is a video of 1-2 hours. It is a close video of 2 hours. So, it was told very well in it how this request response happens. How the browser sends a request and the server responds. So, let me tell you a little briefly here. When we entered in the URL, it sent a request to index.html. And when our browser was understanding index.html, then it got this line number. If we hover this line number here, if you click here, then it reaches line number 8. If you click on it, it reaches line number 8 in HTML. And then it is telling that from this line number 8, a request has been sent to script.js through index.html. So, initiator here means the one who starts. So, this request was started by index.html. And then I clicked on it, so it went up and down. So, then script.js gets the request. And again our server responds to it through a script.js file. Through this file. And we have written so much code in this file. And then we have also put a debugger in our sources here. So, by putting a debugger, everything stops. Not only JavaScript, if everything is in HTML, then everything will stop. So, it has stopped here. Now our browser could not move forward. The browser that was understanding our HTML, could not move forward. So, that is why we cannot see this H1. It could not go to the body. If I put this script on top of this title, then our title will not be visible. Because before setting the title, we are calling JavaScript on line number 7. And inside JavaScript, we are putting a debugger. Debugger means a breakpoint. So, we are pausing our entire code. If I reload it again, then guess what will happen? Till now only H1 was missing. So, will the title also disappear? Because we have put it on top of the title. On top of the title, we have put script.js. So, ideally it should disappear. It should disappear. But if I reload, then it is not disappearing. H1 did not come, that is why it is not disappearing. It is not disappearing because the browser is caching the title. That is why it is not disappearing. Once it is found, it does not want to disappear. That is why it is not disappearing. So, what should I do? If I open it in a new tab, and debugger... If you open it in a new tab, then everything will come. Our code will not stop. Debugger will also not work. If I open it in a new tab, and before pressing enter, I open devtools. Once devtools opens, then debugger will work. Wherever it is, whether it is elements tab, console tab, or sources, any tab will open. Once devtools opens, debugger will work. If I press enter here, then guess what will happen? Will it stop this time? Because, there is no debugger or breakpoint. Because, in this tab, in this particular tab, our javascript code has not come yet. We have not sent the request yet. So, if we enter in the first time, the code will come first. If you go to sources, now debugger is installed. If you enter now, then it will reload. What is the use of opening in a new tab? It is still showing the title. Now, I will tell you a keyword. Put that on this. We will not need this. We will not need debugger. We will not need breakpoint. Put a keyword here, debugger. What is debugger? What is it doing? I will tell you later. Basically, it is pausing the code. It will pause the code whenever our debugger keyword will be encountered. I will tell you more about it later. So, if I open it again in a new tab and if I open devtools as well, then see, here, I will open any element tab and press enter. Now, it is done. It is done as we expected. Our page has become empty. It has become an empty page. And see the title. Our URL is the same title. The title we gave is not working. It is not working now. If I continue this, this resume button, if I click it, see, the title will come and H1 will come. Everything will come at once. So, this is how it works. Our code gets stuck suddenly. Now, I will remove it. And from here, I will make it as it was. So, our html parser or html engine has not reached the body yet. It only reached the script. It only reached the script and we stopped it in the middle. As soon as we stopped it in the middle, it did not move forward. So, we cannot see anything in H1. To prevent this, we can add one thing. I told you in the first video, defer. By adding defer, the call will go to JavaScript. It will come to line number 8. It will call JavaScript. It will send a request immediately. But it will not execute it. It will not execute it until it parses all the html in our body. It will not show it all at once. JavaScript will not start until then. So, if I add defer there, see now, if we reload it again, if I press Ctrl R, my code is visible here. The code of html, whatever I wrote in html, is visible here. You can see a button here. Our html engine, our html parser, has got a chance to put anything in the body. For example, if we add a debugger, this also comes here. But here, a pause and play button comes. This button is present here and here. But a button comes here too. This button was not present in this case when there was no defer. Because our body was not created. Our engine did not reach the body. So, the body did not come there. That's why it was happening like this. So, once I... If you click here, whatever was stuck, whatever was paused, will play automatically with normal speed. Now, if I reload it, see, this thing will not disappear from here. It will reload and it will come in the html. But our code will get stuck. But when will it get stuck? When this line runs. So, the whole body, no matter how many types of body you have, h1, h2, div, everything will come on our page and then JavaScript will start. Ideally, we will do like this. So, we will put a defer here. So, when we put a defer, see now, when I reload it, see here, it did not disappear from here. It is reloading, it did not disappear, nor will it disappear now. Because our html has run so much. And then a button has come here. We can continue it normally from here. If we click on it, it will continue normally and whatever was stuck will end. So, I reload it again. So, this is done. Our html also gets stuck to run JavaScript. But if we want that our html does not get stuck and our html runs completely and then JavaScript runs, then we will put a defer here. Many people remove it from here and put it here, above the body, just above the body. So, what will happen with this? The html will run completely and then JavaScript will get a request. After that, the request will go to JavaScript, and as soon as the request goes, and as soon as the response comes, the JavaScript will run. So in this case too, it will not disappear. If I pause it and reload it again, then see, it is not disappearing. Because our whole HTML has run and the body has been created. H1 has also come in it. So we are not following this approach because suppose if the network is slow, so as long as HTML is being parsed, so if we give up here, so as long as HTML is being parsed, HTML is being shown in our browser, by then our JavaScript file will come through the network. Because the request has already been sent. Now HTML is creating its own HTML. Web page is being created. So by then the request will come, as soon as our body, the end of the body will come, as soon as the entire HTML will be created on our page, immediately our JavaScript will be found, because it has already come. But when we do this, so when our HTML is completely parsed, after that the request goes, when this line encounter happens here. So the request goes, then its response comes immediately, then it runs immediately. So in this case, our JavaScript file is also very slow, and we are running it directly on the local host, so the network will also be very fast, so nothing will be known. But when we work in production, so when we work in our actual projects in the company, so the files are very long, there are a lot of big files, there are files of 1000, 2000, 10,000 lines, if the files are so long, then it is separated into different files, but 1000 lines are very common, 1000 lines are very easy. So in that case, we use this defer, and this is a very good thing, very good, and we will use this only, and we have also seen the drawback of using it here. So I have put defer here, now it will work properly. Till now we were understanding how HTML gets stuck, how JavaScript stops HTML from running. So I will reload it again, so now if we come inside here, if you look here, so here you will see something like this, scope, I will make it smaller, otherwise I will do one thing, I will take it out only, you will get a lot of space. I have taken it out suddenly, so see what is happening here, this, our code has paused here, so here you will see, this scope is visible, and this script is visible, inside the scope, so I will close all this now, so for now we will focus only on the scope, so if you have any other option, then close it, so I will open only the scope, and close everything, so that there is no doubt, so if you open global here, if you open global, so here you will see this variable, which we created, firstName, inside this global scope, now what is scope, forget it, just understand that this is a location where our variable is stored, so here firstName, if you scroll, see this is firstName, and here it is undefined, see this, this is firstName, and inside firstName, it is undefined, so this is it, we saw it here, we drew it, so now what happened, the memory creation phase has run, and our code which has paused, has paused in the code execution phase, but after executing, the value will go, when it will run this line, so now our memory has been created, with the name firstName, and it has been kept undefined, here it is undefined, so if I do this line one by one, if you want, our code is stopped here, but if you want, you can do it one by one, and move it forward, if you press this button, or the shortcut is showing here, F9, so press this button, as soon as you press, see our line, which is green, it will come here, here, it will come here, and you can also hover here, as soon as you hover, it is showing here, that it is undefined, so this means, that our code has been created, in the memory, and if you click on the lastName, it is not showing undefined here, but we will come to the lastName, because we have used let here, so we are not able to access it, so the value is not showing here, so, but it has been created, now we will see that also, so we will do one by one, and move forward, as soon as we click, it will not go to empty space, empty space is not doing anything, so, as soon as we are coming here, see this, as soon as we came to this line, this line was executed, this line went, so in this firstName, Aakash has come, and if you scroll here again, in this firstName, so Aakash has come, earlier it was undefined, now Aakash has come, so where is this lastName? lastName does not come in global, it comes in this, see, by using let and const, whatever you create, all the variables, they will come in the script, whatever you create by using var, they will go in global, so, this script is also global in a way, but from another way, means, from another way, so, javascript categorized it differently, that whatever you did by using const and let, we will keep it in the script, so, this is also a global scope, so, so, here, means, here is age, so age, and lastName, lastName, year of birth, so, basically, here, in alphabetical order, so, lastName was created earlier, so, here, in alphabetical order, and see, it is undefined in all, here, though we are not able to access it by hovering, but here, it is showing us undefined, so, we saw this, see, we created all the variables, lastName also, so, in memory creation phase, everything is done, in memory creation phase, everything is done, now, when we execute the code, as soon as we click on next line, means, here, lastName, so, now, this line is not executed, when we click on it again, then it will be executed, and the value of this variable will go inside it, so, see, I have executed it, means, this line is running, now, the line, our control, this green color, you can see it, now, our program has reached here, so, when I clicked on it, our program has reached here, so, now, if you hover over it, so, its axis is coming here, to hover, so, now, actually, a code execution phase is running here, and, in memory, one by one, our variables are going, so, now, there is nothing in age, when you hover over it, nothing is shown, so, here, in age, it is undefined, nothing is there, it is undefined, so, when I move it forward, this line will run, as soon as this line runs, in age, it will be 15, then, if we move it forward, so, now, see, script.js will go out of it, so, now, now, it has gone directly to the comment, but, after this, it will go to another file, so, as soon as I run this line, in year of birth, our value has come, now, by hovering over it, we can see its value, now, if we move it forward, so, it will go to another file, so, you don't need to go to it, it is JavaScript's own file, which is using behind the scenes, so, close it, and, you don't need to move forward, you will play it directly, now, see, our page is getting reloaded, here, see, it is still loading, loading, so, we play it, and, play it to the side, so, I have played it, so, see, the reload is gone, so, we can pause the code like this, by putting a debugger here, by putting a breakpoint, and, we can see each value, what is going inside it, so, this breakpoint, we can't just put it like this, if there is another way, we can put it like this, so, if there is another way, if we want, then, in our javascript file, in our javascript file, I will remove this, once, so, in this file, if I write, debugger, default, debugger, if I write, still, my code, the execution of the code, will stop, so, if I, see here, if I reload it, see, it has stopped here, on this page, if I reload it, so, it opens its dev tools, and shows, and it shows, that your code, has stopped on this line number, and this green, is showing here, so, it has stopped on line number 1, so, we can stop the code, by using debugger, and then, the exact same thing, will be like this, one by one, you will move forward, we have access to first name, because, we have created using var, but, we don't have access to let and const, so, here, even after hovering, it is not showing, but, here, in the scope tab, we can see, in the scope tab, but, it is not accessible, if you, in the code, if we, do console.log first name, then, it shows, before initialization, you have tried to access it, so, by using let and const, whenever we create a variable, so, until, the value does not go inside it, before that, before that, means, until, by default, javascript put undefined inside it, so, till then, it stays in a zone, and that zone is called, temporal dead zone, temporal dead zone, its name, is, just, keep it, in such a place, that, it cannot be used, in the program, till, the value goes inside it, till, the value goes inside it, it will come out of, temporal dead zone, so, temporal dead zone, you can search, on google, and see, temporal dead zone, temporal dead zone, in javascript, here, it is, so, see, temporal dead zone, the period, the period of time, during which, let and const declaration, cannot be used, so, temporal dead zone, is, just related to, let and const, it has nothing to do with, var, so, it is kept, in such a place, that, it cannot be accessed, till, the value goes inside it, so, in this way, our memory is created, we visualized, and saw here, and also, practically, we saw, practically, that, in starting, every value, will be undefined, so, its actual value, will go inside it, one by one, as the code of each line, will be executed, in future, and, we also saw, how we can, pause our code, in the middle, and then, we can hover, each variable, and see, its value, and, in script, we can see, const and let variables, and, in global, we can see, var variables, so, we saw, everything, in this video, and, we can pause, by using breakpoint, in this way, so, I hope, you liked this video, and, I will see you, in the next video, and, I will see you, in the next video, and the code execution that I have created on blackboard, I will provide the pdf or image in the description, you can also go through it, you can see it, you can also use it to revise it. And as much as I have told, not only that, you can also explore by yourself, you can see how variables are coming in the global, how variables are coming in the script, and create more variables by using var, so that you can see more variables here, like I have just created one variable by using var, so try more, experiment more by yourself, by yourself in the dev tools, in the sources tab, come and see how everything is happening, as we move forward, we will see everything in depth, not only the script, there is a call stack, there is a lot, so we will see everything one by one, so explore by yourself, learn by yourself, try by yourself, do it practically by yourself, create new variables by yourself, see how exactly at a point, variables are going in it, and undefined is being replaced by it, do everything practically by yourself, everything is available here, this is the beauty of javascript, you can see everything in javascript, in C program and other programs, it is not that easy to see, and if you have any doubt related to this particular episode, if you have any question, any doubt, if we do this, what will happen if we do that, if you have any doubt, there is a telegram group in the description, join that group, you can directly ask that doubt in the comment, if there is a small doubt, I will directly reply in the comment, but if you have a big doubt, or if you need a conversation, join the telegram group and ask in that group, I will try to solve that, as soon as I am available, and if I am not available, there are many more people there, so keep learning, keep studying, see you in the next video, till then, bye bye.