Now when we start executing the program shown in the following screenshot, the first thing that will happen is Node will run the main function. The main function is the wrapper function we saw over in nodemon (refer to, Installing the nodemon module section in Chapter 2, Node Fundamentals Part-1) that gets wrapped around all of our files when we run them through Node. In this case, by telling V8 to run the main function we are starting the program.
As shown in the following screenshot, the first thing we do in the program is create a variable x, setting it equal to 1, and that's the first statement that's going to run:

Notice it comes in on top of main. Now this statement is going to run, creating the variable. Once it's done, we can remove it from the Call Stack and move on to the next statement, where we make the variable y, which gets set equal to x, which is 1 plus 9. That means y is going to be equal to 10:

As shown in the previous screenshot, we do that and move on to the next line. The next line is our console.log statement. The console.log statement will print y is 10 to the screen. We use template strings to inject the y variable:
console.log(`y is ${y}`);
When we run this line it gets popped on to the Call Stack, as shown here:

Once the statement is done, it gets removed. At this point, we've executed all the statements inside our program and the program is almost ready to be complete. The main function is still running but since the function ends, it implicitly returns, and when it returns, we remove main from the Call Stack and the program is finished. At this point, our Node process is closed. Now this is a really basic example of using the Call Stack. We went into the main function, and we moved line by line through the program.