Comp 101 Program Execution

Program Execution

So you've just written your first program...

Awesome!! You should feel like this right now:

Buuuuut how do we actually get our program to run? Let's talk program execution.

To get our program to execute make sure all files are saved (Control+S on Windows, Command+S on Mac) and enter "npm start" in our terminal. Given that there are no errors in our code our program will launch in our web browser.

But what is actually happening behind the scenes?

When executing a stored program the computer executes our code line-by-line starting from the first line of the main function until it reaches the end of the file.

Once we hit that final curly brace (};) we're done! The computer will stop evaluating our code at this point.