January 2018
Beginner
658 pages
13h 10m
English
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. ...
Read now
Unlock full access